Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Player Checking not working? [FIXED]

This is for a purge game I'm making. What this is supposed to do is keep checking if the #Players is below 6, and when it is it'll display "The Game Needs at Least 6 Players To Begin." but it's not displaying.

while #game.Players:GetChildren() < 6 do
local Players = game.Players:GetChildren()
	for i = 1,#Players do
		Players[i].PlayerGui.Gui.Frame.TextLabel.Text = "The Game Needs at Least 6 Players To Begin."
		wait()
	end
	wait(1)
end

1 comment

0

nothing's coming out on output..

1 answer

✓ Accepted answer
while #(game.Players:GetChildren()) < 6 do --Needed that parentheses
local Players = game:GetService("Players"):GetChildren()
    for i = 1,#Players do
        Players[i].PlayerGui.Gui.Frame.TextLabel.Text = "The Game Needs at Least 6 Players To Begin."
        wait()
    end
    wait(1)
end

This discussion is preserved as it was. New answers, comments, and votes are closed.