[Trigger] Only one lightning is destroyed

Status
Not open for further replies.
Level 7
Joined
Mar 13, 2008
Messages
228
This is my trigger:
  • Radiat Blast
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Radiat Blast
    • Actions
      • For each (Integer A) from 1 to 2, do (Actions)
        • Loop - Actions
          • Unit - Create 1 gggg 2 for Neutral Passive at ((Position of (Casting unit)) offset by 150.00 towards ((Real((Integer A))) x (360.00 / 2.00)) degrees) facing Default building facing degrees
          • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
          • Lightning - Create a Spirit Link lightning effect from source (Position of (Last created unit)) to target (Position of (Casting unit))
          • Set LightningEfeects[(Player number of (Owner of (Casting unit)))] = (Last created lightning effect)
      • Wait 5.00 seconds
      • Lightning - Destroy LightningEfeects[(Player number of (Owner of (Casting unit)))]
But the destroy lightning effect at the end only destroyes one of the lightning effects, any help?
 
Not sure but, does the (Casting Unit) stay stored after a wait? Try with Triggering Unit instead.
 
  • Set LightningEfeects[(Player number of (Owner of (Casting unit)))] = (Last created lightning effect)
This is set to the last created lightning effect.
Use 2 different variables or use on and replace
  • (Player number of (Owner of (Casting unit)))
with
  • For Loop Integer A
and use this at the end:
  • Lightning - Destroy LightningEfeects[1]
  • Lightning - Destroy LightningEfeects[2]
 
Status
Not open for further replies.
Back
Top