Trigger destroys everything

niceone

New Member
Reaction score
3
Hya
Mine trigger works but its removing health of ALL units even buildings but it only needs to remove the health of units
doesn't need to remove health of buildings / hero / anti block(player 12) / anti-lag (every team has 1) (last 2 are normal units)
It has to set the hp from allied and own player to 1 not from all players
It has to destory the anti-lag unit so all auras from the units get turned off and after 1 minuit the anti-lag unit has to return so the auras get back

this is what i have

Code:
antilag
    Events
        Player - Player 1 (Red) types a chat message containing -antilag as An exact match
        Player - Player 2 (Blue) types a chat message containing -antilag as An exact match
        Player - Player 3 (Teal) types a chat message containing -antilag as An exact match
        Player - Player 4 (Purple) types a chat message containing -antilag as An exact match
        Player - Player 5 (Yellow) types a chat message containing -antilag as An exact match
        Player - Player 6 (Orange) types a chat message containing -antilag as An exact match
        Player - Player 7 (Green) types a chat message containing -antilag as An exact match
        Player - Player 8 (Pink) types a chat message containing -antilag as An exact match
        Player - Player 10 (Light Blue) types a chat message containing -antilag as An exact match
        Player - Player 11 (Dark Green) types a chat message containing -antilag as An exact match
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Unit - Set life of (Picked unit) to 1.00)

Thanks to all that help me

*edit the anti-lag unit has no aura but if that unit is removed all auras of ur units wil be removed / restored when unit comes back

lol u remove the aura from the unit and that i dont need only anti lag has to be removed and it has not to be an else action :)
 

Builder Bob

Live free or don't
Reaction score
249
Code:
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
    Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Picked unit) is A structure) Equal to False
                ((Picked unit) is A Hero) Equal to False
                (Owner of (Picked unit)) Not equal to Player 12 (Brown)
                (Unit-type of (Picked unit)) Not equal to anti lag
            Then - Actions
                Unit - Set life of (Picked unit) to 1.00
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Unit-type of (Picked unit)) Equal to anti lag
                    Then - Actions
                        Unit - Remove aura from (Picked unit)
                    Else - Actions
Wait 60.00 game-time seconds
Set MyGroup = (Units of type anti lag)
Unit Group - Pick every unit in MyGroup and do (Actions)
    Loop - Actions
        Unit - Add aura to (Picked unit)
Custom script:   call DestroyGroup(udg_MyGroup)

This will filter what you listed. If you need more things filtered out, just add that to the list of conditions. The life will only be set to 1 for the picked unit if all the conditions are true.

Edit: added removal of the auras after a minute. MyGroup is a global unit group variable. It is needed to prevent a leak by removing the group after it is used

I guess I should add that if the trigger is run multiple times before the 60 seconds has passed, you may get unwanted results when it comes to adding and removal of the auras. However, 1 minute after the last -antilag, you will have auras back, so there is no real problem.
 
S

Sinan_029

Guest
If you made an action which corresponds to the Picked player as the guy above me said, it should work no problem. Like, Event: -antilag whatever Action: Pick every unit in (unit group) and do Action: Kill Picked unit.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top