I've been trying to make this GUI which makes it appear if there aren't enough players in the server. When I go to start a server with 2 players (the minimum amount the script needs), it shows up for one player, but doesn't for the other. This is inside of a GUI, and it's a LocalScript.
local reqPlayers = 2
local reqPlayersText = game.StarterGui.ReqPlayersGUI:FindFirstChild("ReqPlayersText")
--------------------------------
if game.Players.NumPlayers < reqPlayers then
script.Parent.Visible = true
script.Parent.Text = "Two or more players are needed to begin."
repeat wait() until #game.Players:GetPlayers() >= 2
wait(2)
reqPlayersText.Text = "The game is now ready!"
wait(2)
reqPlayersText:TweenPosition(UDim2.new(0,-150,0,250), "Out", "Bounce", 0.35, true)
end

1 comment
Theres no loop so once the server starts or when the script is fired it only runs once :c