Skip to content

Commit

Permalink
Update client.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
Red-Killer authored Apr 15, 2024
1 parent 931a5cf commit ed997d9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ local inArea = false
local ped = PlayerPedId()

-- on player load
RegisterNetEvent('esx:playerLoaded', function()
ped = PlayerPedId()
Citizen.CreateThread(function()
while true do
Wait(2000)
ped = PlayerPedId()
end
end)

local function addMarker(coords, type, scale, color)
Expand All @@ -32,7 +35,7 @@ CreateThread(function()
local model = GetHashKey(Config.NPC.ped)
RequestModel(model)
while not HasModelLoaded(model) do
Citizen.Wait(0)
Wait(0)
end

local npc = CreatePed(4, model, Config.NPC.coords, Config.NPC.heading, false, false)
Expand Down

0 comments on commit ed997d9

Please sign in to comment.