Status
Not open for further replies.

#### Pitakebab

Level 7
So here's my leaderboard which shows kills of all players:
• Scoreboard
• Events
• Time - Elapsed game time is 1.00 seconds
• Conditions
• Actions
• Set board = (Last created leaderboard)
• Player Group - Pick every player in (All players matching ((((Matching player) slot status) Equal to Is playing) and (((Matching player) controller) Equal to User))) and do (Leaderboard - Add (Picked player) to board with label (Name of (Picked player)) and value kills[(Player number of (Picked player))])
• Kill
• Events
• Unit - A unit Dies
• Conditions
• ((Killing unit) belongs to an enemy of (Owner of (Dying unit))) Equal to True
• Actions
• Set kills[(Player number of (Owner of (Killing unit)))] = kills[((Player number of (Owner of (Killing unit))) + 1)]
• Player Group - Pick every player in (All players matching ((((Matching player) slot status) Equal to Is playing) and (((Matching player) controller) Equal to User))) and do (Leaderboard - Change the value for (Picked player) in board to kills[(Player number of (Picked player))])
My problem is that when unit is killed it's not shown in leaderboard. Kills are always 0.

Level 11
First of all, use this condition instead:
((Triggering unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True

It's more logical..

Secondly, look at this line:
Set kills[(Player number of (Owner of (Killing unit)))] = kills[((Player number of (Owner of (Killing unit))) + 1)]
You add +1 to the array index and not to the kills[] value.
Correct one:
Set kills[(Player number of (Owner of (Killing unit)))] = kills[(Player number of (Owner of (Killing unit)))] + 1

I also recommend to use a loop instead of the 'pick players' action.
Sthg like this:

For each integer from 1 to <Number of players> do actions:
-If
--Player(Integer A) slot status Equal to Is playing
--Player(Integer A) controller) Equal to User
-Then
--Leaderboard - Change the value for Player(Integer A) in board to kills[Integer A]

#### Xelephant

Level 6
hmm looks fine for me, but you can use another Update Thingy

just use this
• Leaderboard - Change the value for (Owner of (Killing unit)) in board to kills[Player number of (Owner of (Killing unit))]
So you wont need the Player Group stuff in the Kill Trigger

#### Pitakebab

Level 7
First of all, use this condition instead:
((Triggering unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True

It's more logical..

Secondly, look at this line:
Set kills[(Player number of (Owner of (Killing unit)))] = kills[((Player number of (Owner of (Killing unit))) + 1)]
You add +1 to the array index and not to the kills[] value.
Correct one:
Set kills[(Player number of (Owner of (Killing unit)))] = kills[(Player number of (Owner of (Killing unit)))] + 1
Now it works. Thanks a lot!

Status
Not open for further replies.

Replies
4
Views
961
Replies
2
Views
762