I'm making a script where if the number of players is not 2 then the game will not run. However, it's not working. No errors either.
CODE:
while game.Players.NumPlayers < 1 do Status.Value = "Waiting for more players..." repeat wait (2) until game.Players.NumPlayers >- 1 end Intermission()
game.Players.NumPlayers
is deprecated. Use #game.Players:GetPlayers()
instead
function count() local numofPlayers = 0 for j,k in pairs(game.Players:GetChildren()) do numofPlayers + 1 end repeat wait() until numofPlayers == 2 intermission() end game.Players.PlayerAdded:Connect(count) game.Players.PlayerRemoving:Connect(count)