Make healthtext yellow if less than 50

Hey, I was wondering how I can make my health text that displays the percentage of health left yellow if it gets below 50? I want it to be if it is above 50, then it’s green, but if it is below 50, it’s yellow. Can anyone help? Thanks.

You could make it go from green through to red as the health gets lower by doing something like this:
[lua]local col = Color((1 - health/maxhealth) * 255, health/maxhealth * 255, 0, 255)[/lua]

[editline]08:18PM[/editline]

And setting the colour of the text to col obviously.

Thanks, but no thanks. I just want it to do what I said.

[lua]local col;
if LocalPlayer():Health() > 50 then
col = Color(0, 255, 0, 255);
else
col = Color(255, 255, 0, 255);
end[/lua]

Then set the text colour to col.

[editline]08:27PM[/editline]

Or on one line:
[lua]local col = LocalPlayer():Health()>50 and Color(0, 255, 0, 255) or Color(255, 255, 0, 255);[/lua]

Thank you so much. I am using it right now. Thank you!