freakincage
New Member
- Reaction score
- 1
Well my leaderboard counts kills and works fine but when one unit dies, it counts it 1x10 or something. It isn't counting one kill for one kill but one kill for like 12 kills...
See the problem?
See the problem?
Code:
Create
Events
Time - Elapsed game time is 0.05 seconds
Conditions
Actions
Leaderboard - Create a leaderboard for (All players) titled Kills
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) controller) Equal to User
Then - Actions
Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0
Leaderboard - Show (Last created leaderboard)
Else - Actions
Code:
Count
Events
Unit - A unit Dies
Conditions
(Owner of (Dying unit)) Not equal to (Owner of (Killing unit))
((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
Actions
Set kill[(Player number of (Owner of (Killing unit)))] = (kill[(Player number of (Owner of (Killing unit)))] + 1)
Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to kill[(Player number of (Owner of (Killing unit)))]
Leaderboard - Sort (Last created leaderboard) by Value in Descending order