void main()
{//msmalik681
void self = getlocalvar("self"); //get calling entity
int player = getentityproperty(self,"playerindex"); //get player index
void enemy = getentityproperty(self, "opponent"); //get opponent
if(enemy)
{
int hp = getentityproperty(enemy,"health")-75; // get opponents current hp
//drawstring(100,100,1,health); // for debug use
int x; int y;
if(player==0){x=38; y=36;} // solid life bar location for player 1 should be same as elife but +1 on each coordinate
else if(player==1){x=222; y=40;} // solid bar for player 2
if(hp>1) //if hp above single life bar
{
if(hp>350){drawbox(x,y,75,6,99999,rgbcolor(232,232,232),0); //show colour if hp above life bar by 350
}else if(hp>300){drawbox(x,y,75,6,99999,rgbcolor(192,144,224),0); //show colour if hp above life bar by 300
}else if(hp>250){drawbox(x,y,75,6,99999,rgbcolor(152,104,224),0); //show colour if hp above life bar by 250
}else if(hp>200){drawbox(x,y,75,6,99999,rgbcolor(0,224,136),0); //show colour if hp above life bar by 200
}else if(hp>150){drawbox(x,y,75,6,99999,rgbcolor(152,224,136),0); //show colour if hp above life bar by 150
}else if(hp>100){drawbox(x,y,75,6,99999,rgbcolor(184,224,96),0); //show colour if hp above life bar by 100
}else if(hp>1){drawbox(x,y,75,6,99999,rgbcolor(128,224,48),0);} //show colour if hp above life bar by 1
}
}
}