ID:268944
 
You know in Zelda, how there are the three hearts up at the top, and when you take damage, it takes away a half of a heart? How do I do this? I saw a demo on it, but, sure as how bad my luck is, it said unzip failed....How do I do this?
Just change its icon when it's at 50%. Not that hard...

var
obj
hud
proc
Update()
health
icon='heart.dmi'
icon_state="10"
layer=MOB_LAYER+10
Update(Amount,Max_Amount)
src.icon_state="[min(max(round((max(Amount,1)/Max_Amount)*10),0),10)]"
mob
verb
Update_Health()
var/obj/hud/health/H=locate() in src.client.screen
if(H)
spawn()
H.Update(src.health,src.maxhealth)