the prefentdeath function in a mutator what does it really do?
is it the same as the scorekill function?
prevent death function
- Feralidragon
- Godlike
- Posts: 5493
- Joined: Wed Feb 27, 2008 6:24 pm
- Personal rank: Work In Progress
- Location: Liandri
Re: prevent death function
No, they're different.
PreventDeath is a boolean function that will ultimately decide if a specific player/pawn dies or not (hence the name "prevent death").
If it returns False, then the player dies, if it returns True, then the player shouldn't die and you have to give him some health (otherwise the code will give him just 1HP).
Its most obvious usage is in spawn protection mods or any situation that the player should not die, but it can also be used to do something upon the death of the player (in case all the other mutators PreventDeath return false, or in case you don't care if he ends up really dying or not).
ScoreKill happens only once the players is confirmed to be killed (after PreventDeath returns False, if PreventDeath returns True then ScoreKill does not get called at all).
PreventDeath is a boolean function that will ultimately decide if a specific player/pawn dies or not (hence the name "prevent death").
If it returns False, then the player dies, if it returns True, then the player shouldn't die and you have to give him some health (otherwise the code will give him just 1HP).
Its most obvious usage is in spawn protection mods or any situation that the player should not die, but it can also be used to do something upon the death of the player (in case all the other mutators PreventDeath return false, or in case you don't care if he ends up really dying or not).
ScoreKill happens only once the players is confirmed to be killed (after PreventDeath returns False, if PreventDeath returns True then ScoreKill does not get called at all).
Re: prevent death function
ah, ok.
I guess the relic where you get teleported somewere instead of dying uses this function
I guess the relic where you get teleported somewere instead of dying uses this function