Player characters

Hi. I have made three characters in the game. When connected to the game (multiplayer or singleplayer bots) players and the maximum number of three players want to get picked every one of those characters (it must not happen that two players have the same two character) But how do I do it?

Make a GUI and a script with a boolean value for each character set to false. When someone chooses that character, set their boolean to true. In the GUI, if someone clicks the character that has a true value (already chosen), then pop a window saying “That character is already in use by (username)” or something like that.