Help with health text color(SOLVED)

A

awsome129

Guest
So I have my player's health drawn on my screen in the color green, but i want to somehow change the color of the text to red when the health is equal to or less than 25. I tried using variables and it didn't work. Here is my code for the drawn health:

Code:
//Draw the health
if (global.reghealth = true && global.redhealth = false)
{
draw_set_color(c_green) 
draw_text(32,32,"Health:")
draw_text(100,32,string(global.health))
}
else
{
if (global.redhealth = true && global.redghealth = false)
{
draw_set_color(c_red) 
draw_text(32,32,"Health:")
draw_text(100,32,string(global.health))
}
}


PLEASE HELP!!!
 
D

Dengar

Guest
what did it do wrong when it didn't work? did it stay red or not turn red at all?
 

FrostyCat

Redemption Seeker
Why can't you just do this?
Code:
if (global.health <= 25) {
  draw_set_colour(c_red);
}
else {
  draw_set_colour(c_green);
}
draw_text(32, 32, "Health:" + string(global.health));
 
A

awsome129

Guest
The text stayed green(the set color if the health is above 25). i.e. when the health got to 25 and lower in value, it didn't not change the color to red.
 
A

awsome129

Guest
Why can't you just do this?
Code:
if (global.health <= 25) {
  draw_set_colour(c_red);
}
else {
  draw_set_colour(c_green);
}
draw_text(32, 32, "Health:" + string(global.health));
that worked. Thank you so much. Idk y i didn't think of that but ty.
 
Top