• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Kills BAR

Status
Not open for further replies.
Level 4
Joined
Jul 18, 2008
Messages
76
HEY GUYS. how do i create a hero-kills window?
only for hero-kills, a player get 1 kill.
I also want it to count up to 100 kills and the one who gets 100 kills wins the map.
Thanks.
 
Search the forums
I'm sure plenty of people have explained it already

Anyway, here's the basics
Use a variable array to store the number of kills each player has

Whenever a hero dies, increment the killcount for the killing player and update the leaderboard. Check if the killcount is now 100, and if so, end the game.
 
I made 2 simple triggers for you.
They are leakfree and MUI.
Add this trigger:

  • Leaderboard
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set Leaderboard_Players = (All players matching (((Matching player) slot status) Equal to Is playing))
      • Leaderboard - Create a leaderboard for Leaderboard_Players titled Heroes Killed
      • Set Leaderboard = (Last created leaderboard)
      • For each (Integer A) from 1 to (Number of players in Leaderboard_Players), do (Actions)
        • Loop - Actions
          • Set Heroes_Killed[(Integer A)] = 0
          • Leaderboard - Add (Picked player) to Leaderboard with label ((Name of (Player((Integer A)))) + kills:) and value Heroes_Killed[(Player number of (Player((Integer A))))]
      • Leaderboard - Show Leaderboard
      • Custom script: call DestroyForce(udg_Leaderboard_Players)
That will add the leaderboard.

  • Kill Counts
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Set Heroes_Killed[(Player number of (Owner of (Killing unit)))] = (Heroes_Killed[(Player number of (Owner of (Killing unit)))] + 1)
      • Leaderboard - Change the value for (Owner of (Killing unit)) in Leaderboard to Heroes_Killed[(Player number of (Owner of (Killing unit)))]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Heroes_Killed[(Player number of (Owner of (Killing unit)))] Equal to 100
        • Then - Actions
          • Game - Victory (Owner of (Killing unit)) (Show dialogs, Show scores)
        • Else - Actions
That will update the leaderboard and show the new kills.
If the kills reaches 100, the killer wins the game.
 
Status
Not open for further replies.
Back
Top