this is in a barrel npc in a level. you are sapost to slash the barrel a bunch of times untill the barrel has 0 hits left, then it gives you cash.
the only part that wont work is the give you cash part at the botem.
PHP Code:
//NPC by theHAWKER
function onCreated(){
this.hits = 1000;
setTimer(.5);
}
function onWa****(){
this.hits -= int(random(1,10));
onHitCheck;
}
function onTimeout(){
this.chat = @this.hits@ " hits left!";
setTimer(.5);
}
//#CLIENTSIDE
function onHitCheck(){
if (this.hits == 0 || this.hits < 0){
player.chat = "I got 250$!";
player.rupees += 250;
onCreated();
}
echo("HitCheckIsWorking");
}