Hi,
I am working on a game that works on a round-based system. When the round starts the game gets all the players that are participating and stores them in an array. The game works with a “tagger”, which is randomly picked from the players. The “tagger” catches the other players which passes on the tag to them. When a specified time limit passes, the script eliminates the current “tagger”. It then selects a new player as the “tagger”.
However I don’t know how I can account for players that leave mid-match. As at the moment the script does not remove the from the array. I thought of placing the array in a String value and removing the leaving player from another script with a .PlayerRemoving event, however I realised that in very rare cases, the PlayerRemoving script and the standard game elimination might occur at the same time, leading to an overwrite of the array, thus causing the main game script to break at some point.
I also need my main game script to randomly select another player as the new “tagger” if the player that is leaving is currently the “tagger”.
Could anyone help me out?
Thanks,
happyfloppy6