Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Untitled Trigger 003

Events


Unit - A unit Is attacked

Conditions

Actions


Player - Add -1 to (Owner of (Attacking unit)) Current lumber
Untitled Trigger 006

Events


Unit - A unit Is attacked

Conditions


((Owner of (Attacking unit)) Current lumber) Equal to 0

Actions


Unit - Order (Attacking unit) to Stop
It doesn't matter wether you use gold,lumber,items with charges,leaderboard, or whatever else you can come up with.
It will still take your ammo when you are starting to shoot because the event "A Unit is Attacked" refers to when the unit STARTS to attack.
If you want him to actualy attack you need a damage detection system.
If he will do that trigger, I am sure that if the attack missed, the lumber/ammo of the owner of unit will not be deducted.
Ammo System

Events


Unit - A unit Is attacked

Conditions


((Owner of (Attacking unit)) controller) Equal to User

Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




((Owner of (Attacking unit)) Current gold) Not equal to 0



Then - Actions




Player - Add -1 to (Owner of (Attacking unit)) Current gold



Else - Actions




Unit - Order (Attacking unit) to Stop
Reload System

Events


Player - Player 1 (Red)'s Current gold becomes Equal to 0.00


Player - Player 2 (Blue)'s Current gold becomes Equal to 0.00


Player - Player 3 (Teal)'s Current gold becomes Equal to 0.00


Player - Player 4 (Purple)'s Current gold becomes Equal to 0.00


Player - Player 5 (Yellow)'s Current gold becomes Equal to 0.00


Player - Player 6 (Orange)'s Current gold becomes Equal to 0.00


Player - Player 7 (Green)'s Current gold becomes Equal to 0.00


Player - Player 8 (Pink)'s Current gold becomes Equal to 0.00

Conditions

Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




((Triggering player) Current lumber) Not equal to 0



Then - Actions




Game - Display to (Player group((Triggering player))) the text: Reloading...




Wait 5.00 seconds




Player - Add -1 to (Triggering player) Current lumber




Player - Set (Owner of (Casting unit)) Current gold to 30



Else - Actions




Game - Display to (Player group((Triggering player))) the text: Out of ammo!




Wait until (((Triggering player) Current lumber) Greater than 0), checking every 0.50 seconds




Trigger - Run (This trigger) (checking conditions)
ReloadSkill System

Events


Unit - A unit Finishes casting an ability

Conditions


(Ability being cast) Equal to Reload

Actions


Trigger - Run Reload System (checking conditions)
