Gold given to amount of units

sionts

New Member
Reaction score
0
How do you give gold to player that owns a unit, in a periodic event. The more of this unit, the more gold.

This is what i already have:
Code:
Events
Time - Every 2.00 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        (Unit-type of (Triggering unit)) Equal to Mini Tower
    Then - Actions
        Player - Add 1 to (Owner of (Triggering unit)) Current gold
    Else - Actions
        Do nothing
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Set UnitGroup = all units of type <your unit here>
Pick every unit in UnitGroup and do
- Player - Add 10 to (Owner of (Picked unit)) current Gold


Where "UnitGroup" is a variable of type "unit group".
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Some example maybe:
Code:
FreeGold
    Events
        Time - Every 10.00 seconds of game time
    Conditions
    Actions
        Set UnitGroup = (Units of type Farm)
        Unit Group - Pick every unit in UnitGroup and do (Actions)
            Loop - Actions
                Player - Add 10 to (Owner of (Picked unit)) Current gold
        Set UnitGroup = (Units of type Scout Tower)
        Unit Group - Pick every unit in UnitGroup and do (Actions)
            Loop - Actions
                Player - Add 20 to (Owner of (Picked unit)) Current gold
        Set UnitGroup = (Units of type Barracks)
        Unit Group - Pick every unit in UnitGroup and do (Actions)
            Loop - Actions
                Player - Add 50 to (Owner of (Picked unit)) Current gold
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top