Mininum number of players

Hello everyone! Quick question: How can I make a game start only when there are at least 4 players?

Example:

for _, Player in pairs(Players:GetChildren())do
if Player.Character and Player.Character:FindFirstChild(‘Humanoid’) then
Player.Character.HumanoidRootPart.CFrame = RandomSpawn.CFrame
end
end

I need to put something more in the “if” line… Like “if the number of players is higher than 3 then”… How can I do that?

You could do

if #Players:GetPlayers() > 3 then
   --Code here for when 4 or more players are in game
end
1 Like

Thank you! I needed to know this to apply it in my script XD

1 Like