From 5d3c051149b0ba032c318c1204af018ec940bb92 Mon Sep 17 00:00:00 2001 From: Andyyy7666 <86536434+Andyyy7666@users.noreply.github.com> Date: Sun, 17 Mar 2024 14:26:11 +0100 Subject: [PATCH] fix(server/vehicle): calculating time --- server/vehicle.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/vehicle.lua b/server/vehicle.lua index 3c7e50e..1cd7e7f 100644 --- a/server/vehicle.lua +++ b/server/vehicle.lua @@ -12,7 +12,7 @@ local function getVehicleType(model) local tempVehicle = CreateVehicle(model, 0, 0, 0, 0, true, true) local time = os.time() - while not DoesEntityExist(tempVehicle) and time-os.time() < 5 do Wait(5) end + while not DoesEntityExist(tempVehicle) and os.time()-time < 5 do Wait(5) end if not DoesEntityExist(tempVehicle) then return end local entityType = GetVehicleType(tempVehicle) @@ -260,7 +260,7 @@ function NDCore.createVehicle(info) local veh = CreateVehicleServerSetter(model, vehType, spawnCoords.x, spawnCoords.y, spawnCoords.z, spawnCoords.w) local time = os.time() - while not DoesEntityExist(veh) and time-os.time() < 5 do Wait(5) end + while not DoesEntityExist(veh) and os.time()-time < 5 do Wait(5) end if not veh or not DoesEntityExist(veh) then return Citizen.Trace("NDCore.createVehicle", "vehicle entity doesn't exist") end