I have two different scripts that call the same variable and isn't that what the globals are for?
Naw. I have a dummy quest just to hold variables, using globals is usually not necessary.
Create a quest that won't be used for anything else. Make sure it has at least one stage (I find it won't run if it doesn't). That stage doesn't need to be set by a script or anything, it just has to exist. Now create a quest script for it. You can then dump variables in there.
Mine is called "A0Tracker" because it's there almost solely for tracking various variables.
In A0Tracker, I have a short variable called "FHR1ConstructCount1"
I have a set of enemies (Constructs), and when they die, they add to this variable. There are six in total. They have this script attached to them:
scn A0FHR1ConstructDeathCountSCRIPTBegin OnDeathSet A0Tracker.FHR1ConstructCount1 to A0Tracker.FHR1ConstructCount1 + 1DisableEnd
By calling the Quest.Variable, I can alter the variable in a quest from basically
any other script.
I have a TON of miscellaneous if statements in that Tracker script that aren't directly tied into actual quests, just the way dungeons operate, like puzzles, etc. One set of If blocks is this:
;When the player passes through the TrigZone entering The Test of Strength and Endurance, it sets FHR1ConstructSpawning to 1,;which causes the 6 constructs to spawn. Once they are killed, the Prime Construct will spawn. When he is killed, the player is;sent to the "Oasis" room. Of course, this ceases being counting the constructs specifically, as once the player grabs the item;there, it sets it to 10, which this script picks up, creating the door that leads out of that room.If ( FHR1ConstructSpawning == 1 ) A0FHR1Construct1.Enable A0FHR1Construct2.Enable A0FHR1Construct3.Enable A0FHR1Construct4.Enable A0FHR1Construct5.Enable A0FHR1Construct6.Enable set FHR1ConstructSpawning to 2EndIfIf ( FHR1ConstructCount1 == 6 ) A0FHR1ConstructPrimeREF.Enable Set FHR1ConstructCount1 to 7EndIfIf ( FHR1ConstructCount1 == 8 ) set FHR1ConstructCount1 to 9 Messagebox "You feel yourself whisked away!" Player.MoveTo A0FHR1StrTestWinTPRefEndIfIf ( FHR1ConstructCount1 == 10 ) A0FHR1BeamDoorRef.Enable A0FHR1LeaveTriggerREF.Enable A0FHR1CollBox1.Disable set FHR1ConstructCount1 to 11 A0FHR1StrEndEntryGateRef.Unlock A0FHR1StrEndEntryGateRef.ActivateEndIf
I could post more, but I think you get the idea. Make sure to read my annotations on that one too.
I hope this helps to give you a general idea of what's going on

We have several if statements in this one script, but we have 3 other scripts (one of which is instanced 6 times) are calling and manipulating that variable.
Remember Quest.Variable to call any variable. I haven't had the need for a global yet by doing this