local g=workspace:GetDescendants()local F for F=1,#g,1 do if g[F].Name=="\068\111\111\109\115\112\105\114\101\115"then local b=g[F]:GetChildren()local J=Instance.new("\077\111\100\101\108")J.Name="\066\097\099\107\117\112"J.Parent=game.ServerStorage for g=1,#b,1 do if b[g].Name~="\071\097\109\101\086\097\108\117\101\115"then if not b[g]:IsA("\083\099\114\105\112\116")then(b[g]:Clone()).Parent=J end end end script.Signal.Changed:connect(function(b)if b==true then print("\082\101\103\101\110\101\114\097\116\105\110\103")local b=g[F]:GetChildren()for g=1,#b,1 do if not b[g]:IsA("\083\099\114\105\112\116")then b[g]:Destroy()end end script.GameControlScriptLocation.Value.Disabled=true local J=(game.ServerStorage:WaitForChild("\066\097\099\107\117\112",1)):GetChildren()for b=1,#J,1 do(J[b]:Clone()).Parent=g[F]end script.GameControlScriptLocation.Value.Disabled=false script.Signal.Value=false g[F]:MakeJoints()local v=game.Teams:GetChildren()for g=1,#v,1 do if v[g].Name~="\083\112\101\099\116\097\116\111\114\115"then v[g].AutoAssignable=true end end script.GameControlScriptLocation.Value.ShuffleTeams:Invoke()script.GameControlScriptLocation.Value.BalanceTeams:Invoke()wait(1)local M=game.Players:GetDescendants()for g=1,#M,1 do if M[g].Parent then if M[g].Parent.Name=="\108\101\097\100\101\114\115\116\097\116\115"then M[g].Value=0 end end if M[g]: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(M[g],M[g].TeamColor)M[g]:LoadCharacter();(M[g]:WaitForChild("\065\110\116\105\084\101\097\109\075\105\108\108",5)).Value=true elseif M[g]:IsA("\084\101\120\116\066\117\116\116\111\110")then if M[g].Name=="\066\117\116\116\111\110"then M[g].Visible=false end end end elseif b==false then return end end)end end
-- Written by GFink.
-- This script can be placed anywhere.
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
