diff --git a/client/functions.lua b/client/functions.lua index 7bc1d3b7..8326b588 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -335,11 +335,10 @@ ESX.Game.Teleport = function(entity, coords, cb) end end -ESX.Game.SpawnObject = function(object, coords, cb, networked, dynamic) +ESX.Game.SpawnObject = function(object, coords, cb, networked) local model = (type(object) == 'number' and model or GetHashKey(object)) local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z) - networked = networked == nil and true or false - dynamic = dynamic ~= nil and true or false + networked = networked == nil and true or networked Citizen.CreateThread(function() ESX.Streaming.RequestModel(model) @@ -347,7 +346,7 @@ ESX.Game.SpawnObject = function(object, coords, cb, networked, dynamic) -- The below has to be done just for CreateObject since for some reason CreateObjects model argument is set -- as an Object instead of a hash so it doesn't automatically hash the item model = type(model) == 'number' and model or GetHashKey(model) - local obj = CreateObject(model, vector.xyz, networked, false, dynamic) + local obj = CreateObject(model, vector.xyz, networked, false, true) if cb then cb(obj) end @@ -372,7 +371,7 @@ end ESX.Game.SpawnVehicle = function(vehicle, coords, heading, cb, networked) local model = (type(vehicle) == 'number' and vehicle or GetHashKey(vehicle)) local vector = type(coords) == "vector3" and coords or vec(coords.x, coords.y, coords.z) - networked = networked == nil and true or false + networked = networked == nil and true or networked Citizen.CreateThread(function() ESX.Streaming.RequestModel(model)