Leaderboards
By Archian
Description
A leaderboard is a table displayed in the top right corner. Each row can contain a name and a value. In most maps this is used for displaying kills wins of your team. In this tutorial I will explain how to setup the leaderboard, how to update the leaderboard and how to remove a leaving player from the board.
The image below is part of a screenshot of a leaderboard.
Sometimes you need more columns than just the two standard, but that is impossible with leaderboards so you will have to use
multiboards. Multiboards are a lot tougher to work with so I will recommend leaderboards.
Creating the Leaderboard
The Event when creating a leaderboard in triggers is very important. Creating the leaderboard with the event below will just not work.

Map Initialization
Use an event like

Time - Elapsed game time is 2.00 seconds
to make it work.
Adjusting the Elapsed game time to 0.00 seconds will work just like Map Initialization and actually work.

Leaderboard
This trigger runs with the event we decided to use. It creats a leaderboard called "Score" and is displayed for all players. Then it loops through each player and if he is playing, he will be added to the board.
Variable
We need something to keep track of the kills for each player so we have to use a variable.
Open the variable editor and create a new variable of the type
Integer.
Call it "PlayerKills" (Because I do).
Check the Array box to keep track of more than just one value.
Updating the Leaderboard
The leaderboard does not update by itself. Each time a value should raise, you have to make it raise. That's why we need a trigger that updates the board.

Trigger Update
This trigger runs every time a unit dies, if the dying unit is an enemy of the killing unit, the PlayerKills variable will raise with one. I put in the condition because I do not want people to make commit teamkills and score by that.
The Leaving Player
Having a leaderboard only display the players who are actually still playing is very important. Or at least make it so people easily can keep track of who are playing and who are not. I decided to make a trigger to remove the leavers from the board. The trigger will look like this:

Leavers
This trigger does only act when player 1, 2 or 3 leavers so add one for each available slot.
The Trigger Functions of Leaderboards
Here's a overview of the functions which are available for leaderboard triggers.
Leaderboard - Create
Creates the leaderboard. Make a main title for the leaderboard.
Leaderboard - Destroy
Destroys a leaderboard. Once destroyed, players can no longer see it.
Leaderboard - Show/Hide
Shows and hides the leaderboard.
Leaderboard - Change Title
Changes the main title of the leaderboard.
Leaderboard - Change Label Colors
Changes the color of a players label.
Leaderboard - Change Value Colors
Changes the color of a players score.
Leaderboard - Change Style
Changes the leaderboard style. You can hide the title, labels, or player values, for all players.
Leaderboard - Add Player
Adds a player to the leaderboard.
Leaderboard - Remove Player
Removes a player from the leaderboard.
Leaderboard - Change Player Label
Changes the label for a player.
Leaderboard - Change Player Label Color
Changes the color of a players label.
Leaderboard - Change Player Value
Updates the value, or score, for a player.
Leaderboard - Change Player Value Color
Changes the color of a players score.
Leaderboard - Change Player Style
Changes the leaderboard style. You can hide the labels or player values, for a specific player.