Wins/Losses are Array variables. In this case their [Index] represents the Player that they're associated with.
So Wins[1] goes with Player 1, Wins[2] goes with Player 2, Wins[3] with Player 3, etc...
You can get the Player number of a Player at any given time as long as you have reference to a Player.
So with that in mind you can make a trigger like this:
-
Events
-
Player - Player 1 (Red) types a chat message containing -Win as An exact match
-
Player - Player 2 (Blue) types a chat message containing -Win as An exact match
-
Player - Player 3 (Blue) types a chat message containing -Win as An exact match
-
Player - Player 4 (Blue) types a chat message containing -Win as An exact match
-
Conditions
-
Actions
-
Set Variable Wins[Player number of (Triggering player)] = (Wins[Player number of (Triggering player)] + 1)
(Triggering player) will be set to whoever typed the message. Their Wins[] will be increased by 1. This single trigger will work
for as many players as you'd like. Just don't put a Wait action in there unless you know what you're doing because it can complicate things.
The basic idea for most Win/Loss save systems would be something like this:
Right before Defeating a player (they must still be in the game when you save), you increase their Losses by 1.
Right before giving a player Victory (again, they must still be in the game), you increase their Wins by 1.
You usually add all of losing players to a Player group and all of your winning players to a Player group beforehand.
Then you can use the Pick Every Player action to easily give the Picked players +1 Win/Loss.
Once that's said and done, you run the Save system for each player, saving their new records.
The only flaw with this system is that players can leave early to avoid getting a loss since it's only recorded at the
end of the game. A solution to this problem is to give every player a loss at the start of the game and then save. Then at the
end of the game, when a team/player has won, you simply subtract a loss from the winners and give them a win. The result
will be that anyone that has left/lost the game will have been given 1 loss and anyone that won will have been given 1 win.
If I were you I would read up on triggers some more and get a better idea of how everything works before jumping right into a system
as complicated as this one.