File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -103,3 +103,20 @@ Disclaimer: The client only loads the mod list from the server a few seconds aft
103103``` lua
104104local mod = exports .newmodels :getModDataFromID (theID )
105105```
106+
107+ ## Spawning a player properly
108+
109+ You always need to pass a model ID to the ` spawnPlayer ` function, which it sets.
110+
111+ If you want to re-spawn a player and keep its custom skin ID, you need to unset it then set it again, in order for the changes to take effect.
112+
113+ ** Server code:**
114+
115+ ``` lua
116+ local data_name = exports .newmodels :getDataNameFromType (" player" )
117+ local id = tonumber (getElementData (player , data_name ))
118+ if id then
119+ removeElementData (player , data_name )
120+ setElementData (source , data_name , id )
121+ end
122+ ```
You can’t perform that action at this time.
0 commit comments