Advertisement
SlenderDaddy

Untitled

Aug 13th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. function hud() -- Consider functions like a cyber button, and everything INSIDE the function turns on when this cyber button is pressed.
  2. local health = LocalPlayer():Health()
  3. draw.RoundedBox(0, 5, ScrH() - 15 - 20, health, 15, Color(255,0,0,255))
  4. draw.SimpleText(health, "default", 10, ScrH() - 15 - 40, Color(255,255,255,255))
  5. end
  6. hook.Add("HUDPaint", "MyHudName", hud) -- I'll explain hooks and functions in a second
  7.  
  8. function hidehud(name)
  9. for k, v in pairs({"CHudHealth", "CHudBattery", "CHudAmmo", "CHudSecondaryAmmo"}) do
  10. if name == v then return false end
  11. end
  12. end
  13. hook.Add("HUDShouldDraw", "HideOurHud:D", hidehud)
  14.  
  15. --Armor
  16. function hud() -- Consider functions like a cyber button, and everything INSIDE the function turns on when this cyber button is pressed.
  17. local armor = LocalPlayer():Armor()
  18. draw.RoundedBox(0, 5, ScrH() - 25 - 75, armor, 15, Color(0,255,255,255))
  19. draw.SimpleText(armor, "default", 10, ScrH() - 25 - 75, Color(0,0,0,255))
  20. end
  21. hook.Add("HUDPaint", "MyHudName", hud) -- I'll explain hooks and functions in a second
  22.  
  23. function hidehud(name)
  24. for k, v in pairs({"CHudHealth", "CHudBattery", "CHudAmmo", "CHudSecondaryAmmo"}) do
  25. if name == v then return false end
  26. end
  27. end
  28. hook.Add("HUDShouldDraw", "HideOurHud:D", hidehud)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement