From 83212d45c2e2e0863e0d306889d289a518fea163 Mon Sep 17 00:00:00 2001 From: Andyyy7666 <86536434+Andyyy7666@users.noreply.github.com> Date: Tue, 26 Sep 2023 23:47:24 +0200 Subject: [PATCH] fix(peds): inconsistency --- client/peds.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/peds.lua b/client/peds.lua index a79aebc..77c745d 100644 --- a/client/peds.lua +++ b/client/peds.lua @@ -123,10 +123,9 @@ function NDCore.createAiPed(info) resource = GetInvokingResource() } - local found, ground = GetGroundZFor_3dCoord(coords.x, coords.y, coords.z, true) - lib.requestModel(model, 500) - function point:onEnter() + local found, ground = GetGroundZFor_3dCoord(coords.x, coords.y, coords.z, true) + lib.requestModel(model) ped = CreatePed(4, model, coords.x, coords.y, found and ground or coords.z, coords.w or coords.h or info.heading, false, false) local time = GetCloudTimeAsInt() @@ -143,7 +142,8 @@ function NDCore.createAiPed(info) TaskPlayAnim(ped, anim.dict, anim.clip, 2.0, 8.0, -1, 1, 0, 0, 0, 0) end - if target and options and DoesEntityExist(ped) then + if target and options then + Wait(500) ox_target:addLocalEntity({ped}, options) end end