local a=workspace:GetDescendants()local s for s=1,#a,1 do if a[s].Name=="\068\111\111\109\115\112\105\114\101\115"then local z=a[s]:GetChildren()local i=Instance.new("\077\111\100\101\108")i.Name="\066\097\099\107\117\112"i.Parent=game.ServerStorage for a=1,#z,1 do if z[a].Name~="\071\097\109\101\086\097\108\117\101\115"then if not z[a]:IsA("\083\099\114\105\112\116")then(z[a]:Clone()).Parent=i end end end script.Signal.Changed:connect(function(z)if z==true then print("\082\101\103\101\110\101\114\097\116\105\110\103")local z=a[s]:GetChildren()for a=1,#z,1 do if not z[a]:IsA("\083\099\114\105\112\116")then z[a]:Destroy()end end script.GameControlScriptLocation.Value.Disabled=true local i=(game.ServerStorage:WaitForChild("\066\097\099\107\117\112",1)):GetChildren()for z=1,#i,1 do(i[z]:Clone()).Parent=a[s]end script.GameControlScriptLocation.Value.Disabled=false script.Signal.Value=false a[s]:MakeJoints()local O=game.Teams:GetChildren()for a=1,#O,1 do if O[a].Name~="\083\112\101\099\116\097\116\111\114\115"then O[a].AutoAssignable=true end end script.GameControlScriptLocation.Value.ShuffleTeams:Invoke()script.GameControlScriptLocation.Value.BalanceTeams:Invoke()wait(1)local j=game.Players:GetDescendants()for a=1,#j,1 do if j[a].Parent then if j[a].Parent.Name=="\108\101\097\100\101\114\115\116\097\116\115"then j[a].Value=0 end end if j[a]:IsA("\080\108\097\121\101\114")then(game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")).ChangeTeamEvent:FireClient(j[a],j[a].TeamColor)j[a]:LoadCharacter();(j[a]:WaitForChild("\065\110\116\105\084\101\097\109\075\105\108\108",5)).Value=true elseif j[a]:IsA("\084\101\120\116\066\117\116\116\111\110")then if j[a].Name=="\066\117\116\116\111\110"then j[a].Visible=false end end end elseif z==false then return end end)end end

local y=workspace:GetDescendants()
local r

for s=1,#y do
	if y[s].Name=="Doomspires" then
		local sa=y[s]:GetChildren()
		local m=Instance.new("Model")
		m.Name="Backup"
		m.Parent=game.ServerStorage
		for i=1,#sa do
			if sa[i].Name~="GameValues" then
				if not sa[i]:IsA("Script") then
					sa[i]:Clone().Parent=m
				end
			end
		end
		script.Signal.Changed:connect(function(Property)
			if Property==true then
				print("Regenerating")
				local ab=y[s]:GetChildren()
				for cd=1,#ab do
					if not ab[cd]:IsA("Script") then
						ab[cd]:Destroy()
					end
				end
				script.GameControlScriptLocation.Value.Disabled=true
				local z=game.ServerStorage:WaitForChild("Backup",1):GetChildren()
				for f=1,#z do
					z[f]:Clone().Parent=y[s]
				end
				script.GameControlScriptLocation.Value.Disabled=false
				script.Signal.Value=false
				
				y[s]:MakeJoints()
				
				local t=game.Teams:GetChildren()
				for d=1,#t do
					if t[d].Name~="Spectators" then
						t[d].AutoAssignable=true
					end
				end
				
				script.GameControlScriptLocation.Value.ShuffleTeams:Invoke()
				script.GameControlScriptLocation.Value.BalanceTeams:Invoke()
				
				wait(1)
				
				local p=game.Players:GetDescendants()
				for q=1,#p do
					if p[q].Parent then
						if p[q].Parent.Name=="leaderstats" then
							p[q].Value=0
						end
					end
					if p[q]:IsA("Player") then
						game:GetService("ReplicatedStorage").ChangeTeamEvent:FireClient(p[q],p[q].TeamColor) -- i could use fireallclients but then i couldnt select the teamcolor property
						p[q]:LoadCharacter()
						p[q]:WaitForChild("AntiTeamKill",5).Value=true
					elseif p[q]:IsA("TextButton") then -- only works in experimental mode
						if p[q].Name=="Button" then
							p[q].Visible=false
						end
					end
				end

			elseif Property==false then
				return
			end
		end)
	end
end
