How do you make a leaderboard based on the total damage dealt?
I've tried this, but this does not seem to work properly. The biggest issues i'm having here is that it only detects player brown (Computer) for some reason, and with every attack he does, the damage dealt tracker is increased by 1. 1-3-6-10-15-21 etc. (The attacking unit have 1-1 damage).
Thanks in advance!
I've tried this, but this does not seem to work properly. The biggest issues i'm having here is that it only detects player brown (Computer) for some reason, and with every attack he does, the damage dealt tracker is increased by 1. 1-3-6-10-15-21 etc. (The attacking unit have 1-1 damage).
Thanks in advance!
-
Run
-
Events
-
Time - Elapsed game time is 5.00 seconds
-
-
Conditions
-
Actions
-
Set VariableSet Hashtable = (Last created hashtable)
-
Player Group - Pick every player in (All players) and do (Actions)
-
Loop - Actions
-
Leaderboard - Create a leaderboard for (All players) titled Damage Dealt
-
Set VariableSet Leaderboard = (Last created leaderboard)
-
Leaderboard - Add (Picked player) to Leaderboard with label (Name of (Picked player)) and value 0
-
Leaderboard - Show Leaderboard
-
-
-
-
-
Damage
-
Events
-
Unit - A unit Is attacked
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Load 0 of 0 from Hashtable.) Not equal to 0
-
-
Then - Actions
-
Player Group - Pick every player in (All players matching ((Owner of (Attacking unit)) Equal to (Matching player)).) and do (Actions)
-
Loop - Actions
-
Set VariableSet DamageDone[(Player number of (Picked player))] = (DamageDone[(Player number of (Picked player))] + ((Load 1 of 1 from Hashtable.) - (Integer((Life of (Attacking unit))))))
-
Leaderboard - Change the value for (Picked player) in Leaderboard to DamageDone[(Player number of (Picked player))]
-
Leaderboard - Sort Leaderboard by Value in Descending order
-
-
-
-
Else - Actions
-
Player Group - Pick every player in (All players matching ((Owner of (Attacking unit)) Equal to (Matching player)).) and do (Actions)
-
Loop - Actions
-
Set VariableSet DamageDone[(Player number of (Picked player))] = (DamageDone[(Player number of (Picked player))] + ((Integer((Max life of (Attacked unit)))) - (Integer((Life of (Attacked unit))))))
-
Leaderboard - Change the value for (Picked player) in Leaderboard to DamageDone[(Player number of (Picked player))]
-
Leaderboard - Sort Leaderboard by Value in Descending order
-
-
-
-
-
-