• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to make a Kill Leaderboard

Level 30
Joined
Aug 29, 2012
Messages
1,382
Here's the very basics of it in two triggers

  • Init
    • Events
      • Time - Elapsed game time is 5.00 seconds // Whatever event you want here
    • Conditions
    • Actions
      • Leaderboard - Create a leaderboard for (All players) titled Kills
      • Set VariableSet MyLeaderboard = (Last created leaderboard)
      • -------- ---------------- --------
      • Leaderboard - Add Player 1 (Red) to MyLeaderboard with label Player 1 and value PlayerKills[1]
      • Leaderboard - Add Player 2 (Blue) to MyLeaderboard with label Player 2 and value PlayerKills[2]
      • (add as many players as you need following the same logic)
      • -------- ---------------- --------
      • Leaderboard - Show MyLeaderboard
  • Kills
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set VariableSet PlayerKills[(Player number of (Owner of (Killing unit)))] = (PlayerKills[(Player number of (Owner of (Killing unit)))] + 1)
      • Leaderboard - Change the label for (Owner of (Killing unit)) in MyLeaderboard to (String(PlayerKills[(Player number of (Owner of (Killing unit)))]))
PlayerKills is an integer variable to keep track of kills, and with an array so that you can assign each player to a number (1 is red, 2 is blue etc). Then you increase the value for said player and reflect it on the leaderboard

You'd probably want to add some conditions to the kills trigger (right now it would count everything, including killing your own stuff)
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Thank you, this looks great.
I was trying to build this trigger myself, but I kept messing up the more complicated part. Could you put this in a test map for me to copy over?
Can you show what you have already? Just leave the complicated parts in their basic form.

Here's how you can post a trigger on Hive:

Remember, everything in the Trigger Editor is categorized and sorted alphabetically. You also have the Search For Text option to find the exact Action you need (it can be picky so refine your search).

With this trigger you're dealing with:
Set Variable action
Leaderboard category (everything leaderboard related is in here)
Event Response functions -> (Player number of player), (Owner of unit), (Killing unit)

Edit: Looks like Chaosium was nice enough to upload it. Disregard this if you'd like but I still think it's good idea to learn how to do this the hard way so you won't struggle in the future.
 
Last edited:
Top