Class: postoffice-getmail
PHP Code:
function onCreated(){
setshape(1,32,32);
}
function onActionGrabbed(){
if (clientr.sentmail == false)
{
if (clientr.sendmailto == null)
{
findNPC("Mail").calcMostSent();
temp.num = findNPC("Mail").mailIDs.size();
temp.mailID = findNPC("Mail").mailIDs[random(0,temp.num)];
clientr.sendmailto = temp.mailID;
temp.msg = "Hmm... this letter is for someone at " @ clientr.sendmailto;
player.chat = temp.msg;
return;
}
else
{
temp.msg = clientr.sendmailto @ " is expecting a letter from you!";
player.chat = temp.msg
return;
}
}
if (clientr.sentmail == true)
{
findNPC("Mail").calcMostSent();
temp.paydol = int(random(4,6));
player.rupees += temp.paydol;
clientr.sendmailto = null;
clientr.sentmail = false;
player.chat = format("Recieved %i rupees", temp.paydol);
return;
}
}
//#CLIENTSIDE
function onCreated() {
setshape(1,32,32);
}
Error Received:
Script compiler output for Class postoffice-getmail:
error: missing semicolon at line 22: return;