Leaderboard Isn't Working

Xebarsis

New Member
Reaction score
7
Hmmm... not quite sure why this trigger isn't working, but it's not. Whenever you kill a unit owned by a user that isn't a summon then you're supposed to get 1 point, but it's not updating. Here's my trigger:

Code:
Part 1
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        Leaderboard - Create a leaderboard for (All players controlled by a User player) titled Kills (50 to win)
        Player Group - Pick every player in (All players) and do (Actions)
            Loop - Actions
                Leaderboard - Add (Picked player) to (Last created leaderboard) with label (Name of (Picked player)) and value 0
        Leaderboard - Show (Last created leaderboard)
        Leaderboard - Sort (Last created leaderboard) by Value in Ascending order

Code:
Part 2
    Events
        Unit - A unit Dies
    Conditions
        ((Owner of (Dying unit)) controller) Equal to User
        ((Dying unit) has buff Animate Dead) Equal to False
        (Owner of (Dying unit)) Not equal to (Owner of (Dying unit))
    Actions
        Set Kills[(Player number of (Owner of (Killing unit)))] = (Kills[(Player number of (Owner of (Killing unit)))] + 1)
        Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to Kills[(Player number of (Owner of (Killing unit)))]
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Kills[(Player number of (Owner of (Killing unit)))] Equal to 50
            Then - Actions
                Set Victory = 1
                Unit - Pause all units
                Game - Display to (All players) the text: (We have a winner! Congratulations to  + ((Name of (Owner of (Killing unit))) + !))
                Wait 7.00 seconds
                Game - Victory (Owner of (Killing unit)) (Show dialogs, Show scores)
                Player Group - Pick every player in (All enemies of (Owner of (Killing unit))) and do (Game - Defeat (Picked player) with the message: (You have lost the game to  + ((Name of (Owner of (Killing unit))) + !)))
            Else - Actions
                Do nothing
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Code:
(Owner of (Dying unit)) Not equal to (Owner of (Dying unit))
I might be confused, but how would this work?
 

Xebarsis

New Member
Reaction score
7
That's supposed to make it so if you kill your own unit, you don't get a point. :D
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Ah, I don't see a problem. Try putting in text to see where it stops.
 

Xebarsis

New Member
Reaction score
7
What type of variable should, "Kills" be? I have it set for an integer that's array.

By the way I put some text in the beginning of the actions section and it's not even reaching that point.
 

cleeezzz

The Undead Ranger.
Reaction score
268
That's supposed to make it so if you kill your own unit, you don't get a point. :D

that doesn't make sense, owner of (dying unit) ALWAYS equals owner of (dying unit), dying unit is the same unit, therefore the owner is the same
, and thus, your trigger actions never run since its impossible to meet your conditions
what your looking for is, Owner of (Killing Unit) not equal to Owner of (Dying Unit)
 

Xebarsis

New Member
Reaction score
7
Don't know why I didn't think about removing that condition and seeing what would happen... that fixed it. Thank you, my leaderboard is now working properly.
 

Ub3r_

New Member
Reaction score
4
Use my multiboard, it's for my TD so change whatever you need to make it work. It works for, I tell you.

Code:
Create
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        Leaderboard - Create a leaderboard for (All players) titled Sunken TD
        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) slot status) Equal to Is playing
                        ((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
                    Else - Actions
                        Do nothing
        Leaderboard - Add Player 12 (Brown) to (Last created leaderboard) with label Lives and value Lives
        Leaderboard - Show (Last created leaderboard)

Code:
Update
    Events
        Unit - A unit Dies
    Conditions
    Actions
        Set Player_Kills[(Player number of (Owner of (Killing unit)))] = (Player_Kills[(Player number of (Owner of (Killing unit)))] + 1)
        Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to Player_Kills[(Player number of (Owner of (Killing unit)))]
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top