How can check if atleast one player character has been loaded into the game

Hi! i would like help on how to detect if there has been atleast one player character added before the game continues the round sequence. Basically, a character doesn’t spawn until they have finished a loading sequence. I’d like help on how I could change my script to begin the round sequence when atleast on character is loaded.

while true do
	local players = playerService:GetPlayers()
	

	if #players >= 1 then
		intermission()

		workspace:SetAttribute("Status", "Loading Map")
		local maps = replicatedStorage:WaitForChild("Maps"):GetChildren()
		local randomMap = maps[math.random(#maps)]
		local newMap = randomMap:Clone()
		currentMap = newMap

		newMap.Parent = workspace
		wait(1)

		runGame(newMap)
	else
		workspace:SetAttribute("Status", "Waiting For Players")		
		print(#players)
		task.wait(1)
	end

end```

you can try looping through all the players in the server and checking their Character property. if every player’s Character is nil, then there is no character in workspace.

easy enough…

local Players = game:GetService("Players")
local function waitForCharacter()
    while true do
        for _, player in ipairs(Players:GetPlayers()) do
            if player.Character then
                return
            end
        end task.wait()
    end
end
waitForCharacter()
-- let's go