Sadly this doesn't have the red splotch with the hitpoints but try it anyways
First add this boolean to client.java
Code:
public boolean Traps(int anim, int hitpower) {
if(misc.random(10) <= 5) {
staticAnimation(anim, absX, absY, 0);
hitDiff = misc.random(hitpower);
dmg = hitDiff;
updateRequired = true;
hitUpdateRequired = true;
sendMessage("You've Activated a TRAP you lost "+dmg+" Hitpoints!");
return true;
}
return false;
}
Heres how to implant it into an object
use this example case's format
Code:
case test:
Traps(GraphicIDhere, MAXhithere);
if(Traps == false) {
//add what you want to do if a trap isn't triggered
}
break;