• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] I need help!

Status
Not open for further replies.
Level 10
Joined
Oct 2, 2014
Messages
215
I need help! (Solved)

In a map i am making i need to kill units in a region after someone leaves that region.
What i need is when the hero leaves a stage of a map, the game waits one minute then kills all units in a region that the hero left. But i cannot find out how to do this! If anyone knows i would really like it if someone could help me.
(Sorry if none of that made sense)
 
Last edited:
Level 14
Joined
Nov 17, 2010
Messages
1,265
Something like this?

  • Untitled Trigger 001
    • Events
      • Unit - A unit leaves Region <gen>
    • Conditions
      • (Triggering unit) Equal to (==) Hero
    • Actions
      • Wait 60.00 seconds
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Region <gen> contains Hero) Equal to (==) False
          • Then - Actions
            • Custom script: set bj_wantDestroyGroup = true
            • Unit Group - Pick every unit in (Units in Region <gen>) and do (Actions)
              • Loop - Actions
                • Unit - Kill (Picked unit)
          • Else - Actions
 
Level 6
Joined
Jan 17, 2014
Messages
166
Trigger 1:
Event: unit leaves region
Condition: triggering unit = "the hero"
Action:
Trigger off this trigger
Trigger on trigger 2
Set variable Time= 0

Trigger 2: ( non-actif by default)
Event: every 0,2 seconds
Actions:
Set time = time plus 1
If/then/else
If - time = 300
Then:
Set variable "kill_unitgroup" = units in region
Pick every unit in kill_unitgroup
Kill picked unit
Custom script: Call DestroyGroup(udg_kill_unitgroup)
Turn off this trigger
 
Status
Not open for further replies.
Top