Hello, I have a region called Lumber, and I want it so that when I put 10 or more rabbits inside the region, it removes 10 rabbits and gives 15 lumber to the player. Here's my trigger:
Edit: Nevermind, I fixed it
-
RabbitLumber
-
Events
- Unit - A unit enters Lumber <gen>
- Conditions
-
Actions
- Set Temp_Group = (Units in Lumber <gen> matching ((Unit-type of (Matching unit)) Equal to Rabbit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in Temp_Group) Greater than or equal to 10
-
Then - Actions
-
For each (Integer A) from 1 to 10, do (Actions)
-
Loop - Actions
- Set TempUnit = (Random unit from Temp_Group)
- Unit - Remove TempUnit from the game
- Unit Group - Remove TempUnit from Temp_Group
-
Loop - Actions
- Player - Add 15 to (Owner of (Triggering unit)) Current lumber
-
For each (Integer A) from 1 to 10, do (Actions)
- Else - Actions
-
If - Conditions
- Custom script: call DestroyGroup(udg_Temp_Group)
-
Events
-
RabbitLumber
-
Events
- Unit - A unit enters Lumber <gen>
- Conditions
-
Actions
- Set Temp_Group = (Units in Lumber <gen> matching ((Unit-type of (Matching unit)) Equal to Rabbit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in Temp_Group) Greater than or equal to 9
-
Then - Actions
-
For each (Integer A) from 1 to 10, do (Actions)
-
Loop - Actions
- Set TempUnit = (Random unit from Temp_Group)
- Unit - Remove TempUnit from the game
- Unit Group - Remove TempUnit from Temp_Group
-
Loop - Actions
- Player - Add 15 to (Owner of (Triggering unit)) Current lumber
-
For each (Integer A) from 1 to 10, do (Actions)
- Else - Actions
-
If - Conditions
- Custom script: call DestroyGroup(udg_Temp_Group)
-
Events
Edit: Nevermind, I fixed it
Last edited: