Guest User

Untitled

a guest
Jan 22nd, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. local size = 20
  2. local lp = LocalPlayer()
  3.  
  4. hook.Add("HUDShouldDraw", "Hide HUD", function (name)
  5.     if name == "CHudHealth" then return false end
  6. end)
  7.  
  8. hook.Add("HUDPaint", "Draw hearts", function ()
  9.     surface.SetTexture(surface.GetTextureID("gui/silkicons/heart"))
  10.     surface.SetDrawColor(255, 255, 255, 255)
  11.     for i=1, lp:Health()/20 do
  12.         local x = size
  13.         if math.ceil(lp:Health()/20)==i then
  14.             x = (lp:Health()-1)%20+1
  15.         end
  16.         surface.DrawTexturedRectUV(20+(i-1)*(size+10), ScrH() - 20 - size, x, size, size, size)
  17.     end
  18. end)
Add Comment
Please, Sign In to add comment