View Single Post
  #2  
Old 03-31-2006, 09:19 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
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(13232);
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.
__________________
Skyld
Reply With Quote