71
Turok 2 Seeds of Evil Modding/Mapping / Re: Turok 2 Seeds of Evil WIP Projects
« on: July 26, 2018, 07:42:57 PM »
Ok here man this will do things when the player's health is below whatever you want. Place it anywhere in the OnTick section of the players script file which you must add yourself if you haven't yet:
Just change the 10 to whatever you want as well as the "Danger Low Health" message. You'll also need to put this:
up in the top section of the player script where other variables are declared.
Code: [Select]
float PlayerHealth = self.Health();
if (PlayerHealth <= 10 && ShowOnce != 1)
{
Hud.AddMessage("Danger Low Health",120);
ShowOnce = 1;
}
else if (PlayerHealth > 10 && ShowOnce == 1)
{
ShowOnce = 0;
}
Just change the 10 to whatever you want as well as the "Danger Low Health" message. You'll also need to put this:
Code: [Select]
int ShowOnce = 0;
up in the top section of the player script where other variables are declared.