I’m creating a King of the Hill kind of gamemode (a capture point mode). I’m trying to make a check on capture point to see what players are on it.
Each player has a “Team ID” and that is stored in an array that the capture point reads. It will return the ID that has the most players on that team. (if it is equal, it returns 0).
The part that doesn’t seem to work is the order in which it reads. So if 3 players enter with the Team IDs [1, 2, 2], it will return 1 when it should be 2. But if the players enter in the order [2, 2, 1], it will return 2.
Similarly, if it reads [1, 2, 3, 4] it will return 1, and if 1 leaves, it will return 2. So it’s only returning the first value if there are 3+ players on the hill.
I’m trying to figure out why that is happening.