Posted by: Raptor Dan
« on: July 26, 2018, 09:32:19 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: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.
My problem with adding stuff like that is finding the file I need to edit in the first place, where exactly do I find the script that edits the player?
Is it the one that's in the game/defs/actors?