From 26f94268c552043775f8945cd4240eecd5e79ea0 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Sun, 18 Sep 2022 00:51:58 +0100 Subject: [PATCH] fix(es_extended): overriding entity function --- [esx]/es_extended/server/onesync.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/[esx]/es_extended/server/onesync.lua b/[esx]/es_extended/server/onesync.lua index 039c721f..2947f80a 100644 --- a/[esx]/es_extended/server/onesync.lua +++ b/[esx]/es_extended/server/onesync.lua @@ -70,12 +70,12 @@ function ESX.OneSync.SpawnVehicle(model, coords, heading, autoMobile, Properties return end CreateThread(function() - local Entity = autoMobile and Citizen.InvokeNative(`CREATE_AUTOMOBILE`, model, coords.x, coords.y, coords.z, heading) or CreateVehicle(model, coords, heading, true, true) - while not DoesEntityExist(Entity) do + local SpawnedEntity = autoMobile and Citizen.InvokeNative(`CREATE_AUTOMOBILE`, model, coords.x, coords.y, coords.z, heading) or CreateVehicle(model, coords, heading, true, true) + while not DoesEntityExist(SpawnedEntity) do Wait(0) end - Entity(Entity).state:set('VehicleProperties', Properties, true) - local netID = NetworkGetNetworkIdFromEntity(Entity) + Entity(SpawnedEntity).state:set('VehicleProperties', Properties, true) + local netID = NetworkGetNetworkIdFromEntity(SpawnedEntity) cb(netID) end) end