A few things need to be touched up, but overall, a good try.
Quote:
|
triggeraction (x,y,"params[0]","params[1]");
|
Variable names should not be inside "quotes".
Quote:
addweapon Fire Ball;
setshape 1,32,32;
if (playerrupees>=100)
|
PHP Code:
addweapon("Fire Ball");
setshape(1, 32, 32);
if (player.rupees >= 100)
Quote:
|
function onPlayertouchesme()
|
PHP Code:
function onPlayerTouchsMe()
... spelling error.
Quote:
|
triggeraction (x,y,"Touched","Touched");
|
... will produce
PHP Code:
function onActionTouched()
... not
PHP Code:
function onTouched()
Quote:
function onCreated()
{
setshape 1,32,32;
//setshape is needed for all level NPCs triggeractions
//this setsit to a square of tiles 32 pix by 32 pix
}
function onActiontime()
{
server.time+=1;
//no need for incredible accuracy
}
//#CLIENTSIDE
function onCreated()
{
settimer(1);
}
function onTimeout()
{
triggeraction(x,y,"time","time");
settimer(1);
}
|
A better version:
PHP Code:
function onCreated()
{
onTimeout();
}
function onTimeout()
{
server.time ++;
setTimer(1);
}
Although, note that a server. string can only be read serverside.