I'm looking for a basic script that gives every players his own hudtxt (hudtxt2) that shows his HP. I want to delete the HP display from the standard hud and for this the HP should be viewable through a hudtxt.
Thanks
function showhealth(id) local player(id,'health') = hp parse('hudtxt2 ' .. id .. ' 1 "Health: '.. hp ..'" 100 200') end
function showhealth() 	for _, id in pairs( player(0, 'table') ) do 		local HP = player(id, 'health') 		parse('hudtxt2 ' .. id .. ' 1 "\169255255255Health: ' .. HP .. '" 100 200') 	end end addhook("always","showhealth")
mp_hud 126
addhook("spawn","_s") function _s(id) 	 parse('hudtxt2 ' .. id .. ' 1 "\169255255255Health: ' .. player(id,"health") .. '" 100 200') end
addhook("hit","_h") function _h(id) 	 parse('hudtxt2 ' .. id .. ' 1 "\169255255255Health: ' .. player(id,"health") .. '" 100 200') end
addhook("spawn","_spawn") function _spawn(id) parse('hudtxt2 '..id..' 1 "Money: '..player(id,"money")..'" 100 200') end addhook("die","_die") function _spawn(id) parse('hudtxt2 '..id.. '1'' 0 0') end addhook("leave","_leave") function _leave(id) parse('hudtxt2 '..id.. '1'' 0 0') end addhook("build","_build") function _build(id,type,x,y,mode,objectid) 	parse('hudtxt2 '..id..' 1 "Money: '..player(id,"money")..'" 100 200') end
local addhook, parse, player = addhook, parse, player function addhudtxt(id, attacker) id = attacker or id parse("hudtxt2 " .. id .. " 0 \"Health: " .. player(id, "health") .. "\" 320 320") end function freehudtxt(id) parse("hudtxt2 " .. id .. " 0 \"\" 0 0") end for _, hook in ipairs({"spawn", "hit"}) do addhook(hook, " addhudtxt") end for _, hook in ipairs({"die", "leave"}) do addhook(hook, "freehudtxt") end