[JASS] Destroying My Lightning

Status
Not open for further replies.
Level 7
Joined
Oct 14, 2008
Messages
340
Okay honestly, I've looked at a few other threads about lightning effects, and DestroyLightning seems to work fine for everyone else, so what the hell is wrong with this chunk of my script?

JASS:
set light = AddLightningLoc( "CLPB", GetUnitLoc(holder), GetUnitLoc(target))
call TriggerSleepAction(0.11)
call DestroyLightning(light)
set light = null

And yes, i have a lightning local named light.
 
Yeah i figured that much, and switched it up, I'm still having the same problem:
JASS:
set light = AddLightning("CLPB", false, x1, y1, x2, y2)
call TriggerSleepAction(0.11)
call DestroyLightning(light)
set light = null

I tried removing the wait (knowing the lightning would be deleted immediately if it worked) and what do you know, it was destroyed and never appeared. Is there some sort of problem with the wait that's causing the lightning variable to be nullified? or..?

*edit*
After more extensive testing and poking around, I've found that for some reason the wait is causing the trigger to just stop. No actions i add after the wait ever take place, why? D:

*edit #2*
Alright i solved my own problem, I guess using waits in a function called by ForGroup() causes the function to just stop.
So i used a loop instead of ForGroup() and it worked out wonderfully, thanks for the help anyway.
 
Last edited:
Status
Not open for further replies.
Back
Top