uyuyorumstoreuyuyorumstore
um-tutorial

Install

How to install and integrate um-tutorial

Install

Open config.lua and configure it according to your preferences.

For new character clothing menu complete

If you want to trigger this when the new character's clothing menu is complete:

Go to qb-clothing/client/main.lua and add the following line after creatingCharacter = false:

local firstTutorial = false

Then replace qb-clothes:client:CreateFirstCharacter with the event provided below:

RegisterNetEvent('qb-clothes:client:CreateFirstCharacter', function()
    QBCore.Functions.GetPlayerData(function(pData)
        local skin = "mp_m_freemode_01"
        openMenu({
            {menu = "character", label = Lang:t("menu.features"), selected = true},
            {menu = "hair", label = Lang:t("menu.hair"), selected = false},
            {menu = "clothing", label = Lang:t("menu.character"), selected = false},
            {menu = "accessoires", label = Lang:t("menu.accessoires"), selected = false}
        })

        if pData.charinfo.gender == 1 then
            skin = "mp_f_freemode_01"
        end

        ChangeToSkinNoUpdate(skin)
        SendNUIMessage({
            action = "ResetValues",
        })

        firstTutorial = true
    end)
end)

Lastly replace RegisterNUICallback('close', function(_, cb) with the one provided below:

RegisterNUICallback('close', function(_, cb)
    SetNuiFocus(false, false)
    creatingCharacter = false
    disableCam()
    FreezeEntityPosition(PlayerPedId(), false)
    TriggerEvent('qb-clothing:client:onMenuClose')
    if firstTutorial then
        TriggerEvent('um-tutorial:client:openTutorial')
        firstTutorial = false
    end
    cb('ok')
end)

Go to illenium-appearance/client/client.lua and replace InitializeCharacter with the one provided below:

function InitializeCharacter(gender, onSubmit, onCancel)
    SetInitialClothes(Config.InitialPlayerClothes[gender])
    local config = getNewCharacterConfig()
    TriggerServerEvent("illenium-appearance:server:ChangeRoutingBucket")
    client.startPlayerCustomization(function(appearance)
        if (appearance) then
            TriggerServerEvent("illenium-appearance:server:saveAppearance", appearance)
            if onSubmit then
                onSubmit()
            end
        elseif onCancel then
            onCancel()
        end
        Framework.CachePed()
        TriggerServerEvent("illenium-appearance:server:ResetRoutingBucket")
        Wait(100)
        TriggerEvent('um-tutorial:client:openTutorial')
    end, config)
end

Go to fivem-appearance/client/main.lua and replace esx_skin:openSaveableMenu with the one provided below:

AddEventHandler('esx_skin:openSaveableMenu', function(submitCb, cancelCb)
    local config = {
        ped = true,
        headBlend = true,
        faceFeatures = true,
        headOverlays = true,
        components = true,
        props = true
    }
    exports['fivem-appearance']:startPlayerCustomization(function (appearance)
        if (appearance) then
            TriggerServerEvent('fivem-appearance:save', appearance)
            ESX.SetPlayerData('ped', PlayerPedId())
            if submitCb then submitCb() end
        else
            if cancelCb then cancelCb() end
            ESX.SetPlayerData('ped', PlayerPedId())
        end
        Wait(100)
        TriggerEvent('um-tutorial:client:openTutorial')
    end, config)
end)

Go to esx_skin/client/modules/menu.lua and replace Menu:Saveable with the one provided below:

function Menu:Saveable(submitCb, cancelCb, restrict)
    Skin.Last = exports["skinchanger"]:GetSkin()

    self:Open(function(data, menu)
        menu.close()
        Camera:Destroy()

        local skin = exports["skinchanger"]:GetSkin()
        TriggerServerEvent("esx_skin:save", skin)

        if submitCb ~= nil then
            submitCb(data, menu)
        end

        TriggerEvent('um-tutorial:client:openTutorial')
    end, cancelCb, restrict)
end

Add the following to the bottom of um-tutorial config.lua:

if not IsDuplicityVersion() then
    AddEventHandler('rcore_clothing:charcreator:done', function()
        TriggerEvent('um-tutorial:client:openTutorial')
    end)
end

Or add it wherever you want

TriggerEvent('um-tutorial:client:openTutorial')

On this page