• Health Bar Losing Health Problem
    4 replies, posted
Hello! I've recently started getting into making HUDs and I've encountered something I don't know how to solve. If the player has over 100 health the health bar won't go down until the players health is 100 or less anyone know how to deal with this? Pardon if I poorly worded this.
You're going to need to post some code, it sounds like a clamp is on the health
local Health = math.Clamp( LocalPlayer():Health() or 0, 0, 100 )     local Healthmax = LocalPlayer():GetMaxHealth() or 100     HealthLerp = Lerp( FrameTime()* 7, HealthLerp, Health) surface.DrawRect( x - 220, y, (440) * HealthLerp / 100, 40 ) -- Health Bar This is everything I have for the health.
Yep, right here: local Health = math.Clamp( LocalPlayer():Health() or 0, 0, 100 ) Change the clamp 3rd argument to be their max health, and it'll be good. Just make sure you are setting their max health after you set their normal health
Thanks I'll give it a try.
Sorry, you need to Log In to post a reply to this thread.