I have been working on making a league of legends health bar. However I have not been able to get it working completely.
Help would be appreciated.
What is a LoL style health bar you ask?
It is a health bar that is a full length health bar like this [============] but when you go over 100 HP the health bar splits into seperate bars and each new bar that is formed represents an additional 100hp when full.
So a LoL health bar that is 300 HP would look like this [====|====|====]
I am trying to make it so that no matter how much HP I have the Bars will correctly split into sections and continue to properly progress each bar individually and properly represent the correct amount of life.
Currently I have made my health bars Progress based off of HP, and I have made a new set of health bars that draws rectangles in a row like based off of the HP.
I am having trouble getting the health bars to progress properly meaning the last one in the line moves down only.
To give you an idea of what I might be working with here is some sample code:
-- simple rounded box rectangle for hp local hp = LocalPlayer():Health() draw.RoundedBox(0, 10, ScrH() - 15 - 20, hp, 15, Color(255,0,0,255)) // the hp bar -- a simple way to draw rectangles in a row local n = hp/10 if n < 11 then surface.SetDrawColor(255,0,0,255) for i=0,n-1 do surface.DrawRect((25+(9*i))/800*ScrW(),(600-75)/600*ScrH(),6/800*ScrW(),4/600*ScrH()) end surface.SetDrawColor(100,10,10,255) for i=n,9 do surface.DrawRect((25+(9*i))/800*ScrW(),(600-75)/600*ScrH(),6/800*ScrW(),4/600*ScrH()) end end