Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local size = 20
- local lp = LocalPlayer()
- hook.Add("HUDShouldDraw", "Hide HUD", function (name)
- if name == "CHudHealth" then return false end
- end)
- hook.Add("HUDPaint", "Draw hearts", function ()
- surface.SetTexture(surface.GetTextureID("gui/silkicons/heart"))
- surface.SetDrawColor(255, 255, 255, 255)
- for i=1, lp:Health()/20 do
- local x = size
- if math.ceil(lp:Health()/20)==i then
- x = (lp:Health()-1)%20+1
- end
- surface.DrawTexturedRectUV(20+(i-1)*(size+10), ScrH() - 20 - size, x, size, size, size)
- end
- end)
Add Comment
Please, Sign In to add comment