Array integer problem

Kazuga

Let the game begin...
Reaction score
110
Hi there, I'm currently working on simple kill count trigger. However it bugs up for some reason. The value is increased by 2 the first kill and then it won't increase at all (wich I would guess is because it's for some reason set to 2 instead of added). The value is supposed to increase by 1 for each kill...
Code:
Death
    Events
        Unit - A unit Dies
    Conditions
        And - All (Conditions) are true
            Conditions
                ((Triggering unit) is A Hero) Equal to True
                ((Killing unit) is A Hero) Equal to True
    Actions
        Set PlayerScore[(Player number of (Owner of (Killing unit)))] = ((Player number of (Owner of (Killing unit))) + 1)
        Leaderboard - Change the value for (Owner of (Killing unit)) in (Last created leaderboard) to PlayerScore[(Player number of (Owner of (Killing unit)))]
        Cinematic - Ping minimap for (All players) at (Position of (Killing unit)) for 4.00 seconds
        Game - Display to (All players) for 7.00 seconds the text: (((Name of (Owner of (Killing unit))) + |cffff0000 just slaughtered |r) + ((Name of (Owner of (Dying unit))) + !))
        Wait 5.00 seconds
        Hero - Instantly revive (Triggering unit) at (Random point in Spawn <gen>), Hide revival graphics
        Camera - Pan camera for (Owner of (Triggering unit)) to (Position of (Triggering unit)) over 1.00 seconds
        Unit - Set mana of (Triggering unit) to 100.00%
        Unit - Make (Triggering unit) Invulnerable
        Wait 2.00 seconds
        Unit - Make (Triggering unit) Vulnerable
What have I done wrong?
 

darkbeer

Beer is Good!
Reaction score
84
Code:
        Set PlayerScore[(Player number of (Owner of (Killing unit)))] = [COLOR="Red"]((Player number of (Owner of (Killing unit))) + 1)[/COLOR]

should be

Code:
        Set PlayerScore[(Player number of (Owner of (Killing unit)))] =  PlayerScore[(Player number of (Owner of (Killing unit)))]  + 1
 

wewso

New Member
Reaction score
11
Code:
Set PlayerScore[(Player number of (Owner of (Killing unit)))] = ((Player number of (Owner of (Killing unit))) + 1)

Change to PlayerScore[((Player number of (Owner of (Killing unit))) + 1)]

EDIT: Too late :D
 

Kazuga

Let the game begin...
Reaction score
110
Aah ofcourse^^ Thanks + rep to both:thup:.

Edit: Sorry, can't give to darkbeer yet...
 
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