From ed997d94c44705c8dd90c557f4e4d79d36111583 Mon Sep 17 00:00:00 2001 From: Red Killer <59504268+Red-Killer@users.noreply.github.com> Date: Mon, 15 Apr 2024 14:44:22 +0200 Subject: [PATCH] Update client.lua --- client.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client.lua b/client.lua index 7f59fc1..f95e72f 100644 --- a/client.lua +++ b/client.lua @@ -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) @@ -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)