Uses a serverr.flag. Noticed there wasen't one here at all. I know this is simple and easy, but soom scriptin newbie will be happy it's here.
Has access for only one person to get rupees out. Keep my name in it or else.
PHP Code:
//created by Cyril (SDE)
function onCreated(){
this.setshape(1, 32, 32);
server.myrupees;
}
function onPlayerChats()
{
if (player.chat.starts("donate"))
{
temp.takerupees = player.chat.tokenize()[1];
serverr.myrupees += temp.takerupees;
player.rupees -= temp.takerupees;
clientr.myrupees += temp.takerupees;
}
if (player.chat.starts("take"))
{
if (player.account == "Account Name")
{
if (!(serverr.myrupees < 0))
{
temp.prupees = player.chat.tokenize()[1];
if (!(serverr.myrupees < temp.prupees))
{
player.rupees += temp.prupees;
serverr.myrupees -= temp.prupees;
}
}
}
}
}
//#CLIENTSIDE
function onPlayerEnters(){
this.chat = "Rupees: " @ serverr.myrupees @ "";
}
function onPlayerTouchsMe(){
say2("You have contributed
" @ clientr.myrupees @ "
Rupees");
}