ZiggyJoJo / brp-fivem-appearance

A simple character creator for FiveM
https://ziggys-scripts.tebex.io
26 stars 55 forks source link

Character doesn't show when first spawn if not using command #14

Open luthanirgi opened 3 years ago

luthanirgi commented 3 years ago

using command /reloadskin fix this issue, but i tried this instead using command and not working at all.

local playerLoaded = false
local firstSpawn = true
AddEventHandler('esx:onPlayerSpawn', function()
    Citizen.CreateThread(function()
        while not playerLoaded do
            Citizen.Wait(100)
        end

        if firstSpawn then
          ESX.TriggerServerCallback('fivem-appearance:getPlayerSkin', function(appearance)
               exports['fivem-appearance']:setPlayerAppearance(appearance)
          end)
          firstSpawn = false
        end
    end)
end)
ImpulsJL commented 2 years ago

Did you found a solution? having the same issue