Quote:
Originally Posted by killerogue
Yes. Hold on a minute.
Could work, couldn't work. Might want to put this in a class and let me know.
|
Umm... you can't set a players sword power or hearts clientside. Also, this.firstpower and this.firsthearts are undefined. You also managed to mix up the order (clientr. is set when the player leaves?).
I'll write it in GS2 first and i'll try and work it out in GS1
PHP Code:
function onCreated()
{
this.sethearts=10;
this.setsword=2;
}
function onPlayerEnters()
{
player.clientr.setsword = player.swordpower;
player.clientr.sethearts = player.fullhearts;
player.swordpower = this.setsword;
player.fullhearts = this.sethearts;
player.chat = "Default stats set!";
}
function onPlayerLeaves()
{
player.swordpower = player.clientr.setsword;
player.fullhearts = player.clientr.sethearts;
player.clientr.setsword = "";
player.clientr.sethearts = "";
player.chat = "Original Stats Restored";
}