How do i make it so it spawns all players before running my next line of code?

So i want my every player to spawn in with CFrame before the next code runs.

	spawn(function() 
		Player.CameraMode = Enum.CameraMode.LockFirstPerson
		wait(1)
		character:FindFirstChild("Torso").CFrame = table.remove(AvailableSpawnPoints, math.random(#AvailableSpawnPoints)).CFrame + Vector3.new(0,10,0) 
		end) 
	end
	
for i = GameSettings.RoundTime, 0, -1 do
-- stuff
end

Don’t use spawn. The function passed is going to execute in another thread.

Also teleport the humanoid root part as it’s found in all body types, r6, r15, rthro aswell.

You can use a for loop to loop through all present players, and apply the CFrame to their Torso. Like so:

local Players = game:GetService("Players")

for i, Player in pairs(Players:GetPlayers()) do
    -- Apply CFrame to Player.Character.Torso
end

-- Next code here

As suggested above, don’t use spawn if you want to apply the CFrame to all player torso’s before moving on. spawn will execute the function in another thread, meaning the script will move on without waiting for the loop to finish.