OnPlayerDeath

From NWN Lexicon

The script attached to this event fires when a player has been reduced to -10 hit points or less. This event could be used to create changes in the storyline, record the deaths of all the players on the server to display at the town square, etc.

Contents

[edit] Trigger

Occurs when a PC dies.

[edit] Function(s)

GetLastHostileActor() can be used on the PC who just died to see who the killer was.

[edit] Remarks

The "nw_o0_death" script is normally used for this module event. This script clears the relationship of the standard factions to the player and determines when the "Death GUI Panel" appears that allows the player to exit NWN or respawn.

[edit] Known Bugs

GetLastKiller() only works for NPCs, and GetLastHostileActor() can be used in its place. This is intended behavior.

[edit] See Also

functions:  GetLastPlayerDied


Personal tools
Categories