ID:265036
 
Code:
mob/proc/Bars()
usr.overlays -= usr.HealthOverlay
var/obj/HealthBar/O = new/obj/HealthBar
var/Length = 10
var/Percent = round((usr.Hp/usr.MHp) * Length)
O.icon_state = "[(Percent>Length)?(Length-1):Percent]"
if(Percent==10)
O.icon_state = "10"
usr.HealthOverlay = O
usr.overlays += usr.HealthOverlay


Problem description:

i found this code in a demo but i dont understand how it works and its not working properly for me