How to: Make a Decent Gate Trigger*Not for beginners with World Editor. This is assuming you know basic knowledge.We've all seen gates in different maps. Some of them better than others. Have you ever wondered how they made it?
Step One: Creating the VariablesIn order to start on our trigger, we'll need some variables.

They should be safe explanatory. The array size is how many gates you will be using.
Step Two: The TriggersYou will only need three triggers for this to work.
Initalization
Events
Map initialization
Conditions
Actions
Set Gate[1] = Demonic Gate (Horizontal) 0000 <gen>
Set Gate[2] = Demonic Gate (Horizontal) 0001 <gen>
Set Gate[3] = Demonic Gate (Horizontal) 0002 <gen>
Set Gate[4] = Demonic Gate (Horizontal) 0003 <gen>
Set Gate[5] = Demonic Gate (Horizontal) 0004 <gen>
For each (Integer A) from 1 to 5, do (Actions)
Loop - Actions
Trigger - Add to Gate Dies <gen> the event (Destructible - Gate[(Integer A)] dies)
Gate Dies
Events
Conditions
Actions
For each (Integer A) from 1 to 5, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Gate[(Integer A)] Equal to (Dying destructible)
Then - Actions
Set Gate[(Integer A)] = No destructible
Else - Actions
Open Close Gates
Events
Time - Every 0.10 seconds of game time
Conditions
Actions
For each (Integer A) from 1 to 5, do (Actions)
Loop - Actions
Set tempPoint = (Position of Gate[(Integer A)])
Set tempGroup = (Units within 300.00 of tempPoint matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) is A structure) Equal to False)))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Gate[(Integer A)] is alive) Equal to True
Gate[(Integer A)] Not equal to No destructible
(Number of units in tempGroup) Greater than 0
Then - Actions
Set GateLife[(Integer A)] = (Current life of Gate[(Integer A)])
Trigger - Turn off Gate Dies <gen>
Destructible - Open Gate[(Integer A)]
Trigger - Turn on Gate Dies <gen>
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Gate[(Integer A)] is dead) Equal to True
Gate[(Integer A)] Not equal to No destructible
(Number of units in tempGroup) Equal to 0
Then - Actions
Destructible - Close Gate[(Integer A)]
Destructible - Set life of Gate[(Integer A)] to GateLife[(Integer A)]
Else - Actions
Custom script: call RemoveLocation(udg_tempPoint)
Custom script: call DestroyGroup(udg_tempGroup)
To those of you who can't tell right off the bat what these do, I'll break it down.
- The trigger "Initialization" sets up the trigger for us. It sets the GateVariable you made before to your Gates.
- The trigger "Gate Dies" makes it so if a certain unit kills the gate, it stays dead.
- The trigger "Open Close Gates" checks within 300 range of each gate if a unit is near it. If it is, it opens the gate, assuming it hasn't been killed by another unit. If there isn't, it closes the gate, again, assuming if it hasn't been killed by another unit.
The only modifications you could add to this code is if you wanted only certain units to trigger them, or if you wanted an ally of a certain player to do it.
Once your done implementing these into your map, test it out. It should work smoothly.