Mindtwistah Posted July 25, 2007 Share Posted July 25, 2007 Is it possible to make a spawn script that you can deactivate by another script? For example if I put a spawn script for an NPC on the OnEnter on a module, and when I kill the NPC I trigger a script that deactivates the spawn script. Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted July 25, 2007 Share Posted July 25, 2007 I'm a rook, but I don't think you need a second script for this.... you just need to set a local or global boolean, and have its value set by death of the NPC in question. Link to comment Share on other sites More sharing options...
stoffe Posted July 25, 2007 Share Posted July 25, 2007 I'm a rook, but I don't think you need a second script for this.... you just need to set a local or global boolean, and have its value set by death of the NPC in question. That's usually how it's done, though you'd set the variable directly after the character has been spawned. Otherwise you'd get a new copy of the character every time the player leaves and re-enters the area, or every time a savegame is loaded in the area (depending on how the spawn script is set up). Usually you only want a character to spawn once. So you just wrap the spawning part of the OnEnter script in a check, like: if (!GetLocalBoolean(OBJECT_SELF, 40)) { SetLocalBoolean(OBJECT_SELF, 40); [color=PaleGreen]/// Spawning code here...[/color] } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.