I want to make a local variable override the global variables tempUnit2 and tempInt but it doesn't seem to be working. I've googled how it's supposed to be done and I can't tell what I'm doing wrong.
-
Actions
-

Custom script: local unit udg_tempUnit2 = GetTrainedUnit()
-

Custom script: local integer udg_tempInt = GetConvertedPlayerId(GetOwningPlayer(udg_tempUnit2))
-
-
// Also tried this
-

// Custom script: local unit udg_tempUnit2 or just local udg_tempUnit2
-

// Custom script: local integer udg_tempInt or just local udg_tempInt
-
-
// Along with
-

// Custom script: set udg_tempUnit2 = GetTrainedUnit()
-

// Custom script: set udg_tempInt = GetConvertedPlayerId(GetOwningPlayer(udg_tempUnit2))
-

-------- Rally --------
-

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-


If - Conditions
-



(Players_Rally_Barracks[tempInt] is hidden) Equal to False
-
-


Then - Actions
-



Unit - Order tempUnit2 to Stop.
-



Wait 0.00 seconds
-



Set VariableSet tempPosition = (Position of Players_Rally_Barracks[tempInt])
-



Unit - Order tempUnit2 to Attack-Move To tempPosition
-



Custom script: call RemoveLocation( udg_tempPosition )
-
-


Else - Actions
-
-



