Jump to content

Access variable from a script outside?


zelxi

Recommended Posts

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:
onDeath

NPC = 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 by zelxi
Link to comment
Share on other sites

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...