• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

Double kill system won't work

Not open for further replies.
Level 11
Jun 26, 2014
  • Double Kill
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Set DKILL = ((Player number of (Owner of (Killing unit))) + 1)
      • Countdown Timer - Start Timer_DKill as a One-shot timer that will expire in 15.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DKILL Equal to 2
        • Then - Actions
          • Player - Add 100 to (Owner of (Killing unit)) Current gold
          • Game - Display to (All players) for 30.00 seconds the text: ((Name of (Owner of (Killing unit))) + just got a |cffff0000double kill|r! He is granted extra |cffffcc00100 gold|r!)
          • Sound - Play Double_kill___Sound_Effect <gen>
        • Else - Actions
  • Timer
    • Events
      • Time - Timer_DKill expires
    • Conditions
    • Actions
      • Set DKILL = 0
So I've been strugglin to make this work. I still cannot see where the problem is.
Level 24
Sep 26, 2009
The first problem I see is that you use variable, not an array.
Everytime you kill hero, you do this: DKILL = ((Player number of (Owner of (Killing unit))) + 1). The (Player number of (Owner of (Killing unit)) part returns number of the killer. For example I think it's number 2 for player 2 (Blue). So what you do is DKILL = 2 + 1 = 3 for player blue. 3 is not equal to 2 no matter how many times you kill anyone.

It should be:
index = (Player number of (Owner of (Killing unit)))
DKILL[index] = DKILL[index] + 1.

Then you need to solve the logic of decrementing this value (or setting it to 0) once timer runs out.
Not open for further replies.