View Single Post
  #4  
Old 09-16-2010, 05:09 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Well judging by your code you still let them hit the NPC for whatever reason so just do something like...

PHP Code:
public function onNPCHit(itemIDdamagerangeattackereffectstypepos) { 
  if (
this.dead) return;
  
this.hp += damage;
  
showHP();
  if (
this.hp <= 0) {
    
this.dead true;
    
hide();
    
sleep(6);
    
show();
    
respawn();
  }
}

function 
respawn() {
  
// your other code
  
this.dead false;

__________________
Quote:
Reply With Quote