I am trying to make a MUI unit removal system. Here's the basics, 4 units will spawn after a unit kills a creep. I want these units to live for 2 seconds then get removed. Problem is, I can't get this to work at multiple times, sometimes the units just won't get destroyed. I attempted at using a timer, but it doesn't seem to want to work.
BTW: Blue, green, red, and purple are the names of the four units i am creating.
Excuse the Jass it's for removing leaks.
Here's the trigger
BTW: Blue, green, red, and purple are the names of the four units i am creating.
Excuse the Jass it's for removing leaks.
Here's the trigger
-
Events
-
Unit - A unit Dies
-
Conditions
-
Actions
-
Set killingunitposition = (Position of (Killing unit))
-
Unit - Create 1 Blue fireworks for Neutral Passive at killingunitposition facing Default building facing degrees
-
Set blue = (Last created unit)
-
Unit - Create 1 Green fireworks for Neutral Passive at killingunitposition facing Default building facing degrees
-
Set green = (Last created unit)
-
Unit - Create 1 Purple fireworks for Neutral Passive at killingunitposition facing Default building facing degrees
-
Set purple = (Last created unit)
-
Unit - Create 1 Red fireworks for Neutral Passive at killingunitposition facing Default building facing degrees
-
Set red = (Last created unit)
-
Unit Group - Add blue to fireworks
-
Unit Group - Add green to fireworks
-
Unit Group - Add red to fireworks
-
Unit Group - Add purple to fireworks
-
Unit Group - Remove all units from fireworks
-
Countdown Timer - Start gametime[(Player number of (Owner of (Killing unit)))] as a One-shot timer that will expire in 2.00 seconds
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Remaining time for gametime[(Player number of (Owner of (Killing unit)))]) Less than or equal to 0.20
-
-
Then - Actions
-
Unit Group - Pick every unit in fireworks and do (Unit - Remove green from the game)
-
Unit Group - Pick every unit in fireworks and do (Unit - Remove red from the game)
-
Unit Group - Pick every unit in fireworks and do (Unit - Remove purple from the game)
-
Unit Group - Pick every unit in fireworks and do (Unit - Remove blue from the game)
-
Custom script: call RemoveLocation(udg_killingunitposition)
-
-
Else - Actions
-
Wait until ((Remaining time for gametime[(Player number of (Owner of (Killing unit)))]) Less than or equal to 0.20), checking every 0.10 seconds
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Remaining time for gametime[(Player number of (Owner of (Killing unit)))]) Less than or equal to 0.20
-
-
Then - Actions
-
Unit Group - Pick every unit in fireworks and do (Unit - Remove green from the game)
-
Unit Group - Pick every unit in fireworks and do (Unit - Remove red from the game)
-
Unit Group - Pick every unit in fireworks and do (Unit - Remove purple from the game)
-
Unit Group - Pick every unit in fireworks and do (Unit - Remove blue from the game)
-
Custom script: call RemoveLocation(udg_killingunitposition)
-
-
Else - Actions
-
-
-
-
-