Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. --[[
  2. Début
  3. ]]
  4. local Health = 0
  5. local Armor = 0
  6. local Hunger = 0
  7.  
  8. local function DrawHealth()
  9.  
  10. Health = math.min(100, (Health == localplayer:Health() and Health) or Lerp(0.1, Health, localplayer:Health()))
  11. Armor = math.min(100, (Armor == localplayer:Armor() and Armor) or Lerp(0.1, Armor, localplayer:Armor()))
  12. Hunger = math.min(100, (Hunger == (localplayer:getDarkRPVar( "Energy" ) or 0) and Hunger) or Lerp(0.1, Hunger, (localplayer:getDarkRPVar( "Energy" ) or 0)))
  13.  
  14. local healthMultipyBg = 123
  15. local healthMultipy = 1.23
  16.  
  17. local hp = LocalPlayer():Health()
  18. local hpBar = math.Clamp(Health,0,100)
  19.  
  20. if Armor <= 0 then
  21. healthMultipy = 2.5
  22. healthMultipyBg = 250
  23. end
  24.  
  25. if Hunger > 0 then
  26. draw.RoundedBox(0,18,ScrH()-40,254,17,Color(0,0,0,255))
  27. draw.RoundedBox(0,20,ScrH()-38,250,12,Color(196,157,0,255))
  28. draw.RoundedBox(0,20,ScrH()-38,math.Clamp(Hunger,0,100)*2.5,12,Color(250,210,0,255))
  29. end
  30.  
  31. draw.RoundedBox(0,18,ScrH()-25,254,17,Color(0,0,0,255))
  32.  
  33. --Health
  34. if hp > 0 then
  35. draw.RoundedBox(0,20,ScrH()-23,healthMultipyBg,13,Color(55,91,65,255))
  36. draw.RoundedBox(0,20,ScrH()-23,hpBar*healthMultipy,13,Color(79,124,91,255))
  37. end
  38.  
  39. -- Armor
  40. if Armor > 0 then
  41. draw.RoundedBox(0,146,ScrH()-23,123,13,Color(23,60,83,255))
  42. draw.RoundedBox(0,146,ScrH())-23,math.Clamp(Armor,0,100)*1.23,13,Color(26,109,159,255))
  43. else
  44. draw.RoundedBox(0,18,ScrH()-38,254,15,Color(0,0,0,255))
  45. end
  46.  
  47. --Health
  48. if hp > 0 then
  49. draw.RoundedBox(0,20,ScrH()-38,healthMultipyBg,13,Color(55,91,65,255))
  50. draw.RoundedBox(0,20,ScrH()-38,hpBar*healthMultipy,13,Color(79,124,91,255))
  51. end
  52.  
  53. -- Armor
  54. if Armor > 0 then
  55. draw.RoundedBox(0,146,ScrH()-38,123,13,Color(23,60,83,255))
  56. draw.RoundedBox(0,146,ScrH()-38,math.Clamp(Armor,0,100)*1.23,13,Color(26,109,159,255))
  57. end
  58.  
  59. if Hunger > 0 then
  60. draw.RoundedBox(0,18,ScrH()-24,254,15,Color(0,0,0,255))
  61. draw.RoundedBox(0,20,ScrH()-23,250,12,Color(196,157,0,255))
  62. draw.RoundedBox(0,20,ScrH()-23,math.Clamp(Hunger,0,100)*2.5,12,Color(250,210,0,255))
  63. end
  64. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement