Frictional Games Forum (read-only)

Full Version: Check when a player Died?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys. I had this great idea in mind but i've come across a problem on making it.

In fact, I wanna make a monster kill a player and then make him "Wake Up"
How can i make this?
How about you check to see if the player has the health of 10 or lower and if it's true, fade out the screen, teleport the player, fade back in, and then play a coughing or breathing sound and reduce sanity to 20 for "sleepy" effects.
Any way to check health?
(05-10-2011, 09:30 PM)laser50 Wrote: [ -> ]Any way to check health?

Code:
GetPlayerHealth();
Though an alternate approach may be to add a collision call back on a script area which is also over the area where the player re-spawns, or just make him respawn where you want him to wake up?
float GetPlayerHealth();

For example:

Code:
void OnStart()
{
     Function01();
}
void Function01()
{
     if (GetPlayerHealth() <= 10)
     {
          Function02();
          return;
     }
}
Maybe use a checkpoint? I don't know if this would work but:
Code:
void Check1(string &in asName, int alCount)    
         {
             ChangeMap("random.map", "PlayerStartArea_1", "", "");
         }
Thought of a work around, as that's what I'm good at, haha.

But, just as suggested, make a check point. The check point spawns the player in a blank spot outside your map, somewhere with just a floor would be alright. Then once the player dies and is sent to that check point, have an area script to teleport the player where you want.