I was wondering how can I change the direction how the health bar will move.
The default is from right to left and I would like to know how can I make the bar when player get hurt to move from left to right.
So basically to move on the opposite way.
If you're drawing a rect, something like:
[lua]
local health = LocalPlayer():Health() / 100;
surface.DrawRect(x, y, w * health, h)
[/lua]
Chess, I think he wants it reversed, as in losing health makes the left hand side of the bar empty before the right hand side
[lua]local health = math.Clamp(LocalPlayer():Health()/100, 0, 1)
local size = w*health
surface.DrawRect( x+(w-size), y, size, h )[/lua]
Sorry, you need to Log In to post a reply to this thread.