Hello! I’m making a button (Gui) in which if a player clicks on this button, then he will add +1 has a value, this part of the button I did but I can’t realize that if a player clicks on the ready button and then exits the game, then he removes -1 has a value (the same value as when you join).
For example, if Player A joins, then he adds 1 to 0/5 (so that makes 1/5) But if Player A leaves the game, then he removes 1 to 1/5 (so that makes 0/5) But if Player A leaves the game without clicking ready, then the value doesn’t change.
Don’t hesitate if you have any questions, ask me!
I am not the one who has questions now am I?
I do not understand the purpose of this topic.
…
Do you have a script for this that does not work? Do you not know where to start? Do you want someone to give you the finished script?
You just described the whole process on how to check the amount of “ready” players to start a game.
I kind of understand what you are saying and I think that it’s pretty simple. However, I won’t make a script for you right now.
Basically, what you can do is add a value and when the GUI button is clicked, a remote event is fired which increases the value by one. You can then add a “PlayerRemoving” event which will make the value subtract itself by one when a player leaves.
To tell if a player has clicked the button, you can add a bool value to the player. If the player has clicked the ready button, then the value will be true, but if the player hasn’t clicked the button, then the button will be false.
Finally, add an if statement in the removing event which only subtract the value if the player that is leaving has a bool value of true.
Hope this helps! ![]()