Skip to content

Commit e0f6f47

Browse files
committed
refactor(client/vehicleProperties): check for tutorial session
1 parent c45aa0d commit e0f6f47

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

resource/vehicleProperties/client.lua

+5-2
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,15 @@ end)
102102
AddStateBagChangeHandler('ox_lib:setVehicleProperties', '', function(bagName, _, value)
103103
if not value or not GetEntityFromStateBagName then return end
104104

105-
local entity = lib.waitFor(function()
105+
while NetworkIsInTutorialSession() do Wait(0) end
106+
107+
local entityExists, entity = pcall(lib.waitFor, function()
106108
local entity = GetEntityFromStateBagName(bagName)
107109

108110
if entity > 0 then return entity end
109-
end)
111+
end, '', 10000)
110112

113+
if not entityExists then return end
111114

112115
lib.setVehicleProperties(entity, value)
113116
Wait(200)

0 commit comments

Comments
 (0)