I am trying to make a GUI that pops up every 5 minutes, notifying you that a brawl is about to start. It has a button to join and leave the brawl, and a queue number for the amount of people joining the brawl.
The problem I am experiencing is that when you click the Join button, the Players value doesn’t change, which prevents the queue from changing, too.
You’re looking in the wrong place for the value. In the video, you’re looking under the StarterGui section, but this section is actually replicated to Player.PlayerGui
If you want to see the value update, you’re going to have to open up the Players, find your player, open PlayerGui, and find the value where it’s supposed to be. As a general tip though, if you’re trying to set up a queue/player match system, I’d recommend having the value on the server since local changes to values don’t replicate to other people.
Thanks! Oh, and by the way, in case you haven’t noticed, I haven’t implemented the 5 minute part yet, but you can tell me how if you want, even though you don’t have to!
I noticed that you’re using a regular script for your Gui. You should not be doing this. When it comes to Gui work, you should be working with LocalScripts and anything that’s intended to influence the game should be facilitated via a RemoteEvent.
In your case, the LocalScript should be detecting input while the RemoteEvent and a server script should be registering queue joins and leaves.
My response still stands. With a LocalScript, changes to a value will not be replicated and only the client will be able to see the change. You need to interface with a RemoteEvent so that the value change can be seen by other clients as well.
No, it won’t, UNLESS you use a RemoteEvent or another safe way to tell the server that the value has changed. Then you can use :FireAllClients() to send the value to each client.
Alright, I don’t know what to do at this point, since I’m pretty sure my code will only work if it’s in a LocalScript, which is where the code is right now… and you need to be using a ServerScript for it to work, so… what am I gonna do?
Make sure the “Players” value is accessible to every client, such as in replicated storage. Use a remote event to increment/decrement the count when a player joins or leaves the queue.