zelxi Posted May 9, 2013 Share Posted May 9, 2013 (edited) Is it possible to access from outside, a variable in a script? I have script attached to a NPC, in that script I have a variable checking if the NPC is dead. I'm trying to access that variable from another script which is attached to a quest. Quest script: if (NPC == dead) <---- anyway to fetch the NPC from NPC script?do --- NPC script:onDeathNPC = dead Sort of, either that or is there a way to terminate a script within a script? Except from markfordelete, I just want the NPC to still be around but not running the script which is attached.. possible? Edited May 9, 2013 by zelxi Link to comment Share on other sites More sharing options...
senterpat Posted May 9, 2013 Share Posted May 9, 2013 (edited) I believe you can do it like this Set npcscript.Variable to blah blah Or If npcscript.variable != whatever Edited May 9, 2013 by senterpat Link to comment Share on other sites More sharing options...
zelxi Posted May 13, 2013 Author Share Posted May 13, 2013 Thanks for reply, I decided to rewrite my code. I'll definitely try that next time. Link to comment Share on other sites More sharing options...
Gribbleshnibit8 Posted May 13, 2013 Share Posted May 13, 2013 What you do is you have a variable in your quest that tracks if that NPC is dead, and the script on the NPC sets the quest variable when the OnDeath block runs. NPC script:BEGIN OnDeath set QuestVar.NPCDead to 1 END Link to comment Share on other sites More sharing options...
Recommended Posts