i got his idea.
addEventHandler("onClientPedDamage", getLocalPlayer(), function()
local hp = getElementHealth(source)
if (hp >= 170) then
-- change to and create image 1 (full hp)
elseif (hp < 170 and >= 140) then
-- image 2
elseif (hp < 140 and >= 110) then
-- image 3
elseif (hp < 110 and >= 80) then
-- image 4
elseif (hp < 80 and >= 50) then
-- image 5
elseif (hp < 50 and >= 20) then
-- image 6
elseif (hp < 20) then
-- almost dying player image
end
end)
addEventHandler("onClientPlayerSpawn", getLocalPlayer(), function()
-- change to full HP image
end)
addEventHandler("onClientPedWasted", getLocalPlayer(), function()
-- change to dead player image
end)
for creating images use:
my_image = guiCreateStaticImage(arguments,goes,here,...)
for changing image use:
guiStaticImageLoadImage(check_wiki,to_see_arguments_list)