What I’m trying to accomplish is to check the player count. If it’s equal or greater than 2, it should print “Player count is equal or greater than 2!”. But this doesn’t work when I test it with a local server. Is it the script that’s wrong or how I’m testing it? All help appreciated!
local minPlayersRequired = false
local players = game.Players:GetChildren()
function checkPlayerCount()
if #players >= 2 then
minPlayersRequired = true
end
end
repeat print("Player count checked") checkPlayerCount() wait(3) until minPlayersRequired == true
if minPlayersRequired == true then
print("Player count is equal or greater than 2!")
end