Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Début
- ]]
- local Health = 0
- local Armor = 0
- local Hunger = 0
- local function DrawHealth()
- Health = math.min(100, (Health == localplayer:Health() and Health) or Lerp(0.1, Health, localplayer:Health()))
- Armor = math.min(100, (Armor == localplayer:Armor() and Armor) or Lerp(0.1, Armor, localplayer:Armor()))
- Hunger = math.min(100, (Hunger == (localplayer:getDarkRPVar( "Energy" ) or 0) and Hunger) or Lerp(0.1, Hunger, (localplayer:getDarkRPVar( "Energy" ) or 0)))
- local healthMultipyBg = 123
- local healthMultipy = 1.23
- local hp = LocalPlayer():Health()
- local hpBar = math.Clamp(Health,0,100)
- if Armor <= 0 then
- healthMultipy = 2.5
- healthMultipyBg = 250
- end
- if Hunger > 0 then
- draw.RoundedBox(0,18,ScrH()-40,254,17,Color(0,0,0,255))
- draw.RoundedBox(0,20,ScrH()-38,250,12,Color(196,157,0,255))
- draw.RoundedBox(0,20,ScrH()-38,math.Clamp(Hunger,0,100)*2.5,12,Color(250,210,0,255))
- end
- draw.RoundedBox(0,18,ScrH()-25,254,17,Color(0,0,0,255))
- --Health
- if hp > 0 then
- draw.RoundedBox(0,20,ScrH()-23,healthMultipyBg,13,Color(55,91,65,255))
- draw.RoundedBox(0,20,ScrH()-23,hpBar*healthMultipy,13,Color(79,124,91,255))
- end
- -- Armor
- if Armor > 0 then
- draw.RoundedBox(0,146,ScrH()-23,123,13,Color(23,60,83,255))
- draw.RoundedBox(0,146,ScrH())-23,math.Clamp(Armor,0,100)*1.23,13,Color(26,109,159,255))
- else
- draw.RoundedBox(0,18,ScrH()-38,254,15,Color(0,0,0,255))
- end
- --Health
- if hp > 0 then
- draw.RoundedBox(0,20,ScrH()-38,healthMultipyBg,13,Color(55,91,65,255))
- draw.RoundedBox(0,20,ScrH()-38,hpBar*healthMultipy,13,Color(79,124,91,255))
- end
- -- Armor
- if Armor > 0 then
- draw.RoundedBox(0,146,ScrH()-38,123,13,Color(23,60,83,255))
- draw.RoundedBox(0,146,ScrH()-38,math.Clamp(Armor,0,100)*1.23,13,Color(26,109,159,255))
- end
- if Hunger > 0 then
- draw.RoundedBox(0,18,ScrH()-24,254,15,Color(0,0,0,255))
- draw.RoundedBox(0,20,ScrH()-23,250,12,Color(196,157,0,255))
- draw.RoundedBox(0,20,ScrH()-23,math.Clamp(Hunger,0,100)*2.5,12,Color(250,210,0,255))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement