Blockland Forums > Modification Help
GameConnection::spawnPlayer - Stuck on Loading Objects
Port:
--- Quote from: CityRPG on January 30, 2012, 10:12:43 AM ---No. spawnPlayer returns the created player object. Do not use that code, you will break other add-ons.
--- Code: ---
--- End code ---
Always, always, always check to see if the parent returns a value when packaging a function or you will break core functionality.
P.S. It violates coding semantics to start a variable with a capital letter.
--- End quote ---
Last time I used it, ::spawnPlayer returned the client. ::createPlayer returns the new player.
CityRPG:
Oof, you're right.
Still, it is returning a value and if it is you need to return it in your code. The only time I do not return the result is when setting a variable to parent:: issues a warning in the console.