package TriggerAndRegenCode
{
function GameConnection::onDeath(%client, %killerPlayer, %killerClient, %damageType, %damageLoc)
{
parent::onDeath(%client, %killerPlayer, %killerClient, %damageType, %damageLoc); //Parent the function
%var = getrandom(1,2); //Get a random number to see which skin the player will have
switch$(%var) //Start the switch
{
case 1: //If random var equals 1 do this
%client.player.nodeColor = "blah"; //Call Black Skin Code function
case 2: // If random var equals 2 do this
%client.player.nodeColor = "blah"; //Call White Skin Code function
}
}
};
Activatepackage(TriggerandRegenCode);
Now keep in mind that this isn't going to work.
Instead of using the death function, you need to use the respawn function, as the players node will be set when they have no playerobject, so when they do respawn nothing is going to happen.