1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
-- images id
hpb={}
hpb1={}
-- colours
r = 0 -- red
g = 255 -- green
b = 0 -- blue
addhook("always","checkhp")
function checkhp(p)
if hpb[p]~=nil then
freeimage(hpb[p])
end
if hpb1[p]~=nil then
freeimage(hpb1[p])
end
hpb1[p]=image("gfx/hpb.bmp",player(p,"x"),player(p,"y"),1)
hpb[p]=image("gfx/hpb.bmp",(player(p,"x")-((player(p,"maxhealth")-player(p,"health"))/2)),player(p,"y"),1)
imagescale(hpb1[p],player(p,"maxhealth"),1)
imagescale(hpb[p],player(p,"health"),1)
imagecolor(hpb[p],r,g,b)
end