qaisjp Posted July 22, 2011 Share Posted July 22, 2011 In this screenshot and I know I have 3 different nametags, but I was just testing. As you see in the normal nametag, the health bar changes color according to the amount of health, i would like the other one to be the same way too. I know i have to edit a few lines just to get the color, but how can I make it "faded" not alpha fade, color faded. Do you get what I mean I have to do some mathematical shit to achieve this, right? Link to comment
Uisaqin Posted July 22, 2011 Share Posted July 22, 2011 first plan the colors u want for different health ranges hp = rgb 100 = 0 255 0 (green) 50 = 255 255 0 (yellow) 0 = 255 0 0 (red) then u can try something like function getHealthColour(Health) if Health >= 50 then return math.ceil((((Health / 50) - 1) * 255)), 255, 0 else return 255, math.ceil((Health / 50) * 255), 0 end end Link to comment
qaisjp Posted July 23, 2011 Author Share Posted July 23, 2011 That worked nicely, thanks a lot. However the colors aren't that accurate but it is still awesome. Thanks again. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now