Author Topic: Execute Clientside Script on First Spawn [Solved]  (Read 4298 times)

I want to load some preferences for a script, when the player first spawns (after joining), and then apply them.
« Last Edit: July 14, 2014, 12:50:22 PM by tommybricksetti »

Made it export a .cs file to config/client/ and execute it at the top of the script. Automatically updates on spawn anyway.

function gameConnection::onClientEnterGame(%client)
you should package this.

Are you wanting to do this server-sided or client-sided?
« Last Edit: July 14, 2014, 11:58:57 PM by Ipquarx »

function gameConnection::onClientEnterGame(%client)
you should package this.
He said clientside so it would be like clientCmdMissionStart or something like that.

He said clientside so it would be like clientCmdMissionStart or something like that.

GameConnection::onConnectionAccepted(%this) Er, oops- first spawn, not when joining. Nevermind.
Just use GameConnection::initialControlSet(%this). If I remember correctly, that's what the game uses too for setting up and showing the PlayGUI.
« Last Edit: July 14, 2014, 09:24:45 PM by Evar678 »

Or you could package handleYourSpawn and use a global variable to check if it's your first time. Then you could package disconnectedCleanup or disconnect and set the variable to false.