Ugh - Leaderboard

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?

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
 

CrackUps

New Member
Reaction score
7
It may not be registering the dying unit as an enemy, it might think it's neutral or something stupid like that. Try temporarily removing that condition and see if it works properly then.
 

freakincage

New Member
Reaction score
1
No it would obviously be one of the actions. Like I said, the leaderboard works, it just doesn't take 1 kill as 1 kill: it takes 1 kill as 10-12 kills. So when I kill a unit in testing, instead of the leaderboard changing my kills to 1, it changes it to like 10...
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top