Skip to content

Commit fcf8cd2

Browse files
spawnPlayer server side only
1 parent 9b4bdf5 commit fcf8cd2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

newmodels_azul/scripts/core/shared_exported.lua

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,15 @@ function setElementModel(element, id)
310310
return newmodelsUtils.setElementCustomModel(element, (id ~= baseModel) and id or nil)
311311
end
312312

313-
-- Sets the skin ID after spawning to re-apply custom model on player
314-
function spawnPlayer(thePlayer, x, y, z, rotation, skinId, ...)
315-
local success = spawnPlayerMTA(thePlayer, x, y, z, rotation, getBaseModelIdFromCustomModelId(skinId), ...)
316-
if success then
317-
setElementModel(thePlayer, skinId)
313+
if not isClientsideScript then
314+
-- Sets the skin ID after spawning to re-apply custom model on player
315+
function spawnPlayer(thePlayer, x, y, z, rotation, skinId, ...)
316+
local success = spawnPlayerMTA(thePlayer, x, y, z, rotation, getBaseModelIdFromCustomModelId(skinId), ...)
317+
if success then
318+
setElementModel(thePlayer, skinId)
319+
end
320+
return success
318321
end
319-
return success
320322
end
321323

322324
newmodelsUtils.handleResourceStop = function(stoppedRes)

0 commit comments

Comments
 (0)