1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function arr(s,v)
	t = {}
	for i=1, s do
		t[i] = v
	end
	return t
end
function hudtxt2(id,tid,text,x,y,align)
	align = align or ""
	parse([[hudtxt2 ]]..id..[[ ]]..tid..[[ "]]..text..[[" ]]..x..[[ ]]..y..[[ ]]..align)
end
count = arr(32,0)
addhook("spawn","initcount")
function initcount(id)
	count[id] = 10 --10*10 = 100 HP
	hudtxt2(id,1,"[ | | | | | | | | | | ]",10,10)
end
addhook("hit","hitcount")
function hitcount(id,src,wpn,hpdmg)
	count[id] = math.ceil((player(id,"health")-hpdmg)/10)
	local asd = "[ "
	for i=1,count[id] do asd = asd.."| " end --Bars
	for i=1,10-count[id] do asd = asd.." " end
	asd = asd.."]" --Fill with whitespace
	hudtxt2(id,1,asd,10,10) --Show
end