So this is what I've got and it isn't working, but it works in a click detector only for some reason?
while true do players = game.Players:GetPlayers() players = game.Players:GetChildren() if #players >= 2 then print("Working") wait(5) end end
I want it to print the message when the game has 2 or more players.
I prefer doing this:
repeat wait() until #game:GetService("Players"):GetChildren() >= 2
This is how you do it in your script:
repeat wait() until #game:GetService("Players"):GetChildren() >= 2 print("Kitty roger, 123") -- rest of your code
The repeat... until isn't a code block like if... then so it goes on one line.
What I did was set it as a value that adds and removes when player joins.
local val = game.ReplicatedStorage.Playercount while true do game.Players.PlayerAdded:Connect(function(player) val.Value = val.Value + 1 end) game.Players.PlayerRemoving:Connect(function(player) val.Value = val.Value - 1 end) wait() end