Hello.
I'm making a custom story where i'm in a nightmare , and i wanna know if it's possible to make the map change (waking up
) if you die.
Help would be appreciated , thanks.
Here's a timer that checks the player's health every 0.2 seconds (this is smallest time to loop without having an effect on performance); if the player's health reaches 0, the map will change:
void OnStart()
{
AddTimer("dead", 0.2f, "Check_Dead");
}
void Check_Dead(string &in asTimer)
{
AddTimer("dead", 0.2f, "Check_Dead");
if(GetPlayerHealth() == 0.0f)
{
ChangeMap("NAME_OF_MAP", "NAME_OF_START_POSITION", "", "");
RemoveTimer(asTimer);
}
}
Hope that helped!
Or you can just set a check point and use the checkpoint callback to call ChangeMap.
kk , Thanks for your help , i did Your Computer's method :>