Character Selection GUI, only one player may use it until they have left or died

Hello! So today I have been presented with what I would call another Issue. I have been learning many different methods about UI manipulation and I have learned enough to sustain my game. One new problem that I have found or an issue that has been presented to me is a UI that has created, the UI has multiple pictures of the character, and when the player has clicked on the button the player is morphed into the character with special abilities and all. My question here is there any efficient way to make it so that no one else can use the character until the player using the character either leave the game or dies. I’m sure this system would be somewhat similar as how some games such as adopt me or bloxburg make houses claimed or unclaimed until the player has left. One idea that has been circulating around my mind is that the button has a Boolean value, if the boolean value is false then the button will be red and display the text “In Use” or “Occupied” once the player has left or died it should display “Play” and the value should be set to false however I do not believe that this is the most efficient way and I have ran into some other glitches because of that. Thank you for anyone who replies in advance.

1 Like

Yeah I would suggest using bool values for those certain characters for example

local BoolValue = Instance.new("BoolValue")
BoolValue.Name = "IsOccupided" -- Whatever you want the name to be

I would use this just so that if someone is using the character then you would Set the bool value to True meaning it is in use.

1 Like

You can use a Table/Array too, containing all ur characters, and set to true on the table once someone is using it, and return it to false when the character is available again