function PlayerManager.preparePlayers()local D=mapManager.getMap()if not D then return end local m=mapManager.getSpawnLocations()if not m then return end local T=m:GetChildren()local Q=Players:GetChildren()for D,m in pairs(Q)do table.insert(activePlayers,m)local Q=T[1]table.remove(T,1)readyPlayer(m,Q)local f=m.Character local k=f:FindFirstChild("\072\117\109\097\110\111\105\100")if k then k.WalkSpeed=gameSettings.roundWalkSpeed end end actionManager:BindGameActions(Q)playersLeft.Value=#activePlayers end

function PlayerManager.preparePlayers()
	-- Get all spawn locations in the folder
	local map = mapManager.getMap()
	if not map then return end
	
	local spawnLocations = mapManager.getSpawnLocations()
	if not spawnLocations then return end
	
	local availableSpawnPoints = spawnLocations:GetChildren()
	
	-- Get active players
	local players = Players:GetChildren()
	
	-- For every active player, load them into a table, and ready them with everything needed for gameplay (tools, listeners, spawn)
	for playerKey, whichPlayer in pairs(players) do
		table.insert(activePlayers,whichPlayer)

		-- Gets a spawn location and then removes it from the table so the next player gets the next spawn
		local spawnLocation = availableSpawnPoints[1]
		table.remove(availableSpawnPoints, 1)
		readyPlayer(whichPlayer, spawnLocation)
		
		-- Set player walkspeed
		local character = whichPlayer.Character
		local humanoid = character:FindFirstChild("Humanoid")
		if humanoid then
			humanoid.WalkSpeed = gameSettings.roundWalkSpeed
		end
	end

	-- Bind destroy action
	actionManager:BindGameActions(players)
	
	-- Update the value so the starting players can be displayed on the GUI
	playersLeft.Value = #activePlayers

end
