• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[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.
 
Level 7
Joined
Oct 14, 2008
Messages
340
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.
Top