function MapManager.SaveMap(G,w)FindAndSaveSpawns(w)for w=#Spawns,1,-1 do if Configurations.TEAMS then if Spawns[w].TeamColor.Name=="\066\114\105\103\104\116 \114\101\100"or Spawns[w].TeamColor.Name=="\066\114\105\103\104\116 \098\108\117\101"then Spawns[w].Neutral=false Spawns[w].Transparency=1 else(table.remove(Spawns,w)):Destroy()end else Spawns[w].Neutral=true Spawns[w].Transparency=1 end end for w,G in pairs(w:GetChildren())do if not G:IsA("\067\097\109\101\114\097")and(not G:IsA("\084\101\114\114\097\105\110")and G.Name~="\077\097\112\080\117\114\103\101\080\114\111\111\102")then local w=G:Clone()if w then w.Parent=MapSave end end end end function MapManager.ClearMap(w)for w,G in ipairs(game.Workspace:GetChildren())do if not G:IsA("\067\097\109\101\114\097")and(not G:IsA("\084\101\114\114\097\105\110")and G.Name~="\077\097\112\080\117\114\103\101\080\114\111\111\102")then G:Destroy()end end end function MapManager.LoadMap(w)spawn(function()for w,G in ipairs(MapSave:GetChildren())do local y=G:Clone()y.Parent=game.Workspace end end)end return MapManager
-- Functions
function MapManager:SaveMap(object)
	FindAndSaveSpawns(object)
	for i = #Spawns, 1, -1 do
		if Configurations.TEAMS then
			if Spawns[i].TeamColor.Name == "Bright red" or Spawns[i].TeamColor.Name == "Bright blue" then
				Spawns[i].Neutral = false
				Spawns[i].Transparency = 1
			else
				table.remove(Spawns, i):Destroy()
			end
		else
			Spawns[i].Neutral = true
			Spawns[i].Transparency = 1
		end
	end

	for _, child in pairs(object:GetChildren()) do
		if not child:IsA("Camera") and not child:IsA("Terrain") and child.Name ~= "MapPurgeProof" then
			local copy = child:Clone()
			if copy then
				copy.Parent = MapSave
			end
		end
	end
end

function MapManager:ClearMap()
	for _, child in ipairs(game.Workspace:GetChildren()) do
		if not child:IsA("Camera") and not child:IsA("Terrain") and child.Name ~= "MapPurgeProof" then
			child:Destroy()
		end
	end
end

function MapManager:LoadMap()
	spawn(function()
		for _, child in ipairs(MapSave:GetChildren()) do
			local copy = child:Clone()
			copy.Parent = game.Workspace
		end
	end)
end

return MapManager
