Local Script
local RefreshText = game.ReplicatedStorage.RefreshText
local player = game.Players.LocalPlayer
local qf = game.ReplicatedStorage.QueueFolder
RefreshText.OnClientEvent:Connect(function()
wait(0.11)
local qf1 = game:GetService("Players"):GetPlayerByUserId(qf.Player1.Value)
local qf2 = game:GetService("Players"):GetPlayerByUserId(qf.Player2.Value)
local qf3 = game:GetService("Players"):GetPlayerByUserId(qf.Player3.Value)
local qf4 = game:GetService("Players"):GetPlayerByUserId(qf.Player4.Value)
local qf5 = game:GetService("Players"):GetPlayerByUserId(qf.Player5.Value)
local qf6 = game:GetService("Players"):GetPlayerByUserId(qf.Player6.Value)
local qf7 = game:GetService("Players"):GetPlayerByUserId(qf.Player7.Value)
if player == qf1 or qf2 or qf3 or qf4 or qf5 or qf6 or qf7 then
local Equation = 7 - game.ReplicatedStorage.QueueFolder.QueueCount.Value
player.PlayerGui.WelcomeScreen.Frame2.TextButton.Text = Equation.." more people are needed to start"
end
end)
Hello! So, the title says most of my problem. What I’m trying to do here, is to change/refresh the player’s gui, but only if they’re in the queue. To do this, I made a folder with number values and changed the values via server script to their UserId when they pressed join queue. Just to put more emphasis, I only want it to change the player’s gui if they’re in the queue.
It works perfectly fine when the second player joins. However, when a third player joins, the third player’s gui changes even though their ID isn’t in the queue/isn’t in any of the number values. Nothing appears in output.
Also, I know some parts of my script may be inefficient so if you have a better method please let me know!
If any further information is needed please let me know.