How to make it so that, depending on which player performed the action, a certain action was performed for this case, and if ANOTHER player performed the same action, then ANOTHER action would be performed.
Example:
2 (or more) players exist on the map for multiplayer (Deathmatch). There is a door. There are 2 variables ones: "scoresof1stplayer" and "scoresof2ndplayer". Both are equal to 0. One player approaches door and beats door. If this door is damaged, a trigger is triggered that adds 1 to the variable "scoreof1stplayer". If the SECOND player hits the SAME DOOR, then the trigger is called again, which now adds 1 to the variable "scoreof2ndplayer".
Different actions must be performed depending on WHICH PLAYER hit the door. HOW TO IMPLEMENT IT?
I wanted to do it with this:
A timer started at the start with a delay of 0 triggered a trigger that determined the value for the variable"currentplayer" as the slot of the current player.
Further.
When any player hit the door, a trigger containing these commands was called:
- Skip next action if value of variable A doesn't equals value B.
A: currentplayer
B: 0
- Add value B to value of variable A.
A: scoreof1stplayer
B: 1
- Skip next action if value of variable A doesn't equals value B.
A: currentplayer
B: 1
- Add value B to value of variable A.
A: scoreof2ndplayer
B: 1
It doesn't work!
Why?!
Instead, if I output the values of these variables to the chat, I (on behalf of the first player) see:
player 0 has 1 of score. (player 0 is the first player)
On behalf of the second (WHO DID NOT TOUCH THIS DOOR!):
player 1 has 1 of score. (player 1 is the second player)
Why 2nd player has this 1 score? Why?
At the same time, if I, the first player, highlight the value of the SECOND player's variable points in the chat, then it will be equal to 0! And the second player sees 1! And the second player sees the same thing from the first player!
That is, one player hit the door 20 times, the second just stood there - And HE (the second player) has 20 POINTS!
WHY?!
I tested it in multiplayer, from two accounts. I checked it with other players (!). WHY?!
WHAT DID I DO WRONG?!
If u dont understand, seeee: i hits door at 20 times. I must have 20 score. I have it. I pressed a button, which activates tigger, which says in chat: "1st player (me) has 20 score. 2nd has 0". Then 2nd player pressed it and see: "1st player has 0 score. 2nd player has 20". Why...