Thread: destroy();
View Single Post
  #1  
Old 08-13-2007, 11:00 PM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
Question destroy();

Ive made a target system, but the targets keep responing, making the targets not disapear and reapear x.x

i need it to destroy every time a player enters and then recreate one.

this is my script:
PHP Code:
//NPC Made By *theHAWKER
function onPlayerChats(){
if (
clientr.staff true){
if (
player.chat "destroy"){
destroy();
}
}
}
function 
onCreated(){
  
setshape(1,32,48);
  
setimg("gl_target.png");
  
this.chat "Shoot Me!";
  
setTimer(.1);
}
function 
onActionAdd(){
  
with(findplayer(params[0])){
    
player.rupees += int(random(0,20));
  }
}
function 
onTimeout(){
hide();
sleep(random(1,3));
show();
sleep(random(1,3));
  
setTimer(.3);
}
//#CLIENTSIDE
function onWasShot(){
  
this.chat "Hit!";
  
triggerserver("gui","-System","addrupees",player.account,int(random(0,20)));
  
sleep(.5);
  
this.chat "Shoot Me!";

__________________
**FLIP OUT**
Reply With Quote