Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Player Checking not working? [FIXED]

Asked by 9 years ago

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
0
nothing's coming out on output.. HungryJaffer 1246 — 9y

1 answer

Log in to vote
1
Answered by
Validark 1580 Snack Break Moderation Voter
9 years ago
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

Ad

Answer this question