function HealthBar(unitId,objectNo)
rem Uses Health(unitID) and maximumHealth(unitID) to calculate a health bar
rem Health bar is sized according to lengthOfBar= and heightOfBar=
rem And is placed above the head of object specified in objectNo.
lengthOfBar=50
heightOfBar=5
if object in screen(objectNo)
if health(unitID)>0
barSize=(health(unitID)*lengthOfBar)/maximumHealth(unitID)
x=object screen x(unitID)
y=object screen y(unitID)
box x,y-20,x+barSize,(y-20)+heightOfBar
endIf
endIf
endfunction

God created the world in 7 days, but we're still waiting for the patch.