I advise using a string:
NPC Code:
if (playerenters&&strequals(#s(client.life),)){
setstring client.life,100;}
if (playerenters||timeout){
showimg 400,imgname.gif,550,45;
changeimgvis 400,4;
changeimgpart 400,0,0,#s(client.life),width;
timeout=.05;}
Thats just the showimg part, and you will have to do the fancy upgrading of life in the player hurt.
like
NPC Code:
if (playerhurt){
if (strtofloat(#s(client.life))!=1){
setstring client.life,#v(strtofloat(#s(client.life))-#v(this.damage/strtofloat(#s(client.strength))));
}
}
if (this.hearts==playerhearts){
if (this.life!=1){
this.old=playerap;
playerap=100;
playerhearts=playerfullhearts;
playerap=this.old;
}else{
this.old=playerap;
playerap=100;
playerhearts=.5;
playerap=this.old;
}
}
if (this.hearts<playerhearts) {
this.hearts=playerhearts;
}
if (this.hearts>playerhearts) {
this.damage=(this.hearts-playerhearts);
this.hearts=playerhearts:
}
Then just upgrade client.strength to be like, 1 to make .5=1 damage, and to make .5=.5 etc...
It should work, and you need timereverywhere.
Its in peices, so put it together.
Enjoy.