do local d=Lib.Map.SectorA.ShutterPart1 local u=Lib.Map.SectorA.ShutterPart2 local x=Lib.Map.SectorA.Wall5A local N=Lib.Map.SectorA.Wall5B local K=Lib.Map.SectorA.WeakPlatformA local l=Lib.Map.SectorA.WeakPlatformB local F=Lib.Map.SectorA.WeakPlatformC local Z=Lib.Map.SectorA.WeakPlatformD local G=Lib.Map.SectorA.LightBase1 local O=Lib.Map.SectorA.Light1 local function H(d,u)water1.DrainSound:Play()Lib.Script.moveWater(water1,Vector3.new(0,-d,0),u,true)end Lib.btnFuncs[1]=function()G.Anchored=false O.BrickColor=BrickColor.new("\068\097\105\115\121 \111\114\097\110\103\101")O.Material=Enum.Material.Neon O.PointLight.Enabled=true K.Anchored=false game.Debris:AddItem(K,5)H(19,3)local u=d Lib.Script.moveWater(u,Vector3.new(0,2,0),1,true)u.MotorSound:Play()delay(1,function()u.MotorSound:Stop()end)end Lib.btnFuncs[2]=function()local u=d Lib.Script.moveWater(u,Vector3.new(0,6,0),3,true)u.MotorSound:Play()delay(3,function()u.MotorSound:Stop()end)end Lib.btnFuncs[3]=function()Lib.Script.setWaterState(water1,"\108\097\118\097")wait(18)x.Anchored=false N.Anchored=false N.BreakSound:Play()end autoEvents[#autoEvents+1]=function()Lib.Script.moveWater(water1,Vector3.new(0,3,0),31,true)wait(31)d.Anchored=false d.BreakSound:Play()Lib.Script.moveWater(water1,Vector3.new(0,16,0),2,true)wait(2)end Lib.btnFuncs[4]=function()Lib.Script.setWaterState(water1,"\097\099\105\100")l.Anchored=false game.Debris:AddItem(Z,5)wait(.5)F.Anchored=false game.Debris:AddItem(F,5)wait(.5)Z.Anchored=false game.Debris:AddItem(l,5)end Lib.btnFuncs[5]=function()H(59,2.5)Lib.Script.setWaterState(water1,"\097\099\105\100")Lib.Script.moveWater(water2,Vector3.new(0,3,0),2.5,true)local d=u Lib.Script.moveWater(d,Vector3.new(0,8,0),6,true)d.MotorSound:Play()delay(16,function()d.MotorSound:Stop()end)end autoEvents[#autoEvents+1]=function()Lib.Script.moveWater(water1,Vector3.new(0,2,0),10.5,true)Lib.Script.moveWater(water2,Vector3.new(0,2,0),10.5,true)wait(10.5)Lib.Script.moveWater(water1,Vector3.new(0,100,0),4,true)Lib.Script.moveWater(water2,Vector3.new(0,-5,0),1,true)u.Anchored=false u.BreakSound:Play()u.MotorSound:Stop()end end do local d=Lib.Map.SectorB.LightBase1 local u=Lib.Map.SectorB.Light1 local x=Lib.Map.SectorB.LightBase2 local N=Lib.Map.SectorB.Light2 local K=Lib.Map.SectorB.LightCables local l=Lib.Map.SectorB.LoosePlatform1 local F=Lib.Map.SectorB.LoosePlatform2 local Z=Lib.Map.SectorB.DoorSeal local G=Lib.Map.SectorB.ClimbPlatforms local O=Lib.Map.SectorB.WeakWall1 local H=Lib.Map.SectorB.WeakWall2 autoEvents[#autoEvents+1]=function()Lib.Script.moveWater(water2,Vector3.new(0,2,0),27.5,true)wait(27.5)end Lib.btnFuncs[6]=function()d.BreakSound:Play()d.Anchored=false x.Anchored=false for d,u in ipairs({u;N})do u.BrickColor=BrickColor.new("\068\097\105\115\121 \111\114\097\110\103\101")u.Material=Enum.Material.Neon u.PointLight.Enabled=true end for d,u in ipairs(K:GetChildren())do u.Enabled=true end end Lib.btnFuncs[8]=function()Lib.Script.moveWater(O,Vector3.new(0,-17,0),1,true)O.ExplosionSound:Play()wait(3)l.Anchored=false l.BreakSound:Play()end autoEvents[#autoEvents+1]=function()Lib.Script.setWaterState(water2,"\108\097\118\097")Lib.Script.moveWater(water2,Vector3.new(0,80,0),17,true)wait(17)end Lib.btnFuncs[9]=function()local d=G.MotorizedPlatform Lib.Script.moveWater(d,Vector3.new(0,-6,0),3,true)d.MotorSound:Play()delay(3,function()d.MotorSound:Stop()end)wait(3.5)F.Anchored=false F.BreakSound:Play()end Lib.btnFuncs[10]=function()Lib.Script.moveWater(H,Vector3.new(0,-17,0),1,true)H.ExplosionSound:Play()end autoEvents[#autoEvents+1]=function()for d,u in ipairs(G:GetDescendants())do if u:IsA("\066\097\115\101\080\097\114\116")then u.Anchored=false end end G:BreakJoints()G.BreakSoundPart.BreakSound:Play()Lib.Script.moveWater(water2,Vector3.new(0,2,0),6,true)wait(6)Z.CFrame=Z.CFrame*CFrame.new(0,7,0)Lib.Script.moveWater(Z,Vector3.new(0,9,0),1,true)Lib.Script.moveWater(water2,Vector3.new(0,14,0),2,true)wait(2)end end
-- The list of events in chronological order.
do -- Sector 1 Events
	local shutterA = Lib.Map.SectorA.ShutterPart1
	local shutterB = Lib.Map.SectorA.ShutterPart2
	local wall1 = Lib.Map.SectorA.Wall5A
	local wall2 = Lib.Map.SectorA.Wall5B
	local weakPlatformA = Lib.Map.SectorA.WeakPlatformA
	local weakPlatformB = Lib.Map.SectorA.WeakPlatformB
	local weakPlatformC = Lib.Map.SectorA.WeakPlatformC
	local weakPlatformD = Lib.Map.SectorA.WeakPlatformD
	local lightBase1 = Lib.Map.SectorA.LightBase1
	local light1 = Lib.Map.SectorA.Light1

	local function drainWater(distance, duration)
		water1.DrainSound:Play()
		Lib.Script.moveWater(water1, Vector3.new(0, -distance, 0), duration, true)
	end

	Lib.btnFuncs[1] = function() -- When the upstairs button is pressed, drain the acid to the sewer.
		lightBase1.Anchored = false
		light1.BrickColor = BrickColor.new("Daisy orange")
		light1.Material = Enum.Material.Neon
		light1.PointLight.Enabled = true

		weakPlatformA.Anchored = false
		game.Debris:AddItem(weakPlatformA, 5)

		drainWater(19, 3)

		local drainDoor = shutterA
		Lib.Script.moveWater(drainDoor, Vector3.new(0, 2, 0), 1, true)
		drainDoor.MotorSound:Play()
		delay(1, function()
			drainDoor.MotorSound:Stop()
		end)
	end
	Lib.btnFuncs[2] = function() -- When the sewer drain button is pressed, open it fully.
		local drainDoor = shutterA
		Lib.Script.moveWater(drainDoor, Vector3.new(0, 6, 0), 3, true)
		drainDoor.MotorSound:Play()
		delay(3, function()
			drainDoor.MotorSound:Stop()
		end)
	end
	Lib.btnFuncs[3] = function()
		Lib.Script.setWaterState(water1, "lava")

		wait(18)

		-- Drop the sticky walls!
		wall1.Anchored = false
		wall2.Anchored = false
		wall2.BreakSound:Play()
	end
	autoEvents[#autoEvents + 1] = function() -- After a while, flood the sewer again!
		Lib.Script.moveWater(water1, Vector3.new(0, 3, 0), 31, true)
		wait(31)

		shutterA.Anchored = false
		shutterA.BreakSound:Play()
		Lib.Script.moveWater(water1, Vector3.new(0, 20 - 4, 0), 2, true)
		wait(2)
	end
	Lib.btnFuncs[4] = function()
		Lib.Script.setWaterState(water1, "acid")

		weakPlatformB.Anchored = false
		game.Debris:AddItem(weakPlatformD, 5)

		wait(0.5)

		weakPlatformC.Anchored = false
		game.Debris:AddItem(weakPlatformC, 5)

		wait(0.5)

		weakPlatformD.Anchored = false
		game.Debris:AddItem(weakPlatformB, 5)
	end
	Lib.btnFuncs[5] = function() -- When the spire drain button is pressed, drain the place and open the door.
		drainWater(59, 2.5)

		Lib.Script.setWaterState(water1, "acid")
		Lib.Script.moveWater(water2, Vector3.new(0, 3, 0), 2.5, true)

		local drainDoor = shutterB
		Lib.Script.moveWater(drainDoor, Vector3.new(0, 8, 0), 6, true)
		drainDoor.MotorSound:Play()
		delay(16, function()
			drainDoor.MotorSound:Stop()
		end)
	end
	autoEvents[#autoEvents + 1] = function() -- Flood the first sector entirely to kill anybody still in there.
		Lib.Script.moveWater(water1, Vector3.new(0, 2, 0), 10.5, true)
		Lib.Script.moveWater(water2, Vector3.new(0, 2, 0), 10.5, true)
		wait(10.5)

		Lib.Script.moveWater(water1, Vector3.new(0, 100, 0), 4, true)
		Lib.Script.moveWater(water2, Vector3.new(0, -5, 0), 1, true)
		shutterB.Anchored = false
		shutterB.BreakSound:Play()
		shutterB.MotorSound:Stop()
	end
end
do -- Sector 2 Events
	local lightBase1 = Lib.Map.SectorB.LightBase1
	local light1 = Lib.Map.SectorB.Light1
	local lightBase2 = Lib.Map.SectorB.LightBase2
	local light2 = Lib.Map.SectorB.Light2
	local lightCables = Lib.Map.SectorB.LightCables
	local loosePlatform1 = Lib.Map.SectorB.LoosePlatform1
	local loosePlatform2 = Lib.Map.SectorB.LoosePlatform2
	local doorSeal = Lib.Map.SectorB.DoorSeal
	local climbPlatforms = Lib.Map.SectorB.ClimbPlatforms
	local weakWall1 = Lib.Map.SectorB.WeakWall1
	local weakWall2 = Lib.Map.SectorB.WeakWall2

	autoEvents[#autoEvents + 1] = function()
		Lib.Script.moveWater(water2, Vector3.new(0, 2, 0), 27.5, true)
		wait(27.5)
	end
	Lib.btnFuncs[6] = function()
		lightBase1.BreakSound:Play()
		lightBase1.Anchored = false
		lightBase2.Anchored = false
		for i, light in ipairs({ light1, light2 }) do
			light.BrickColor = BrickColor.new("Daisy orange")
			light.Material = Enum.Material.Neon
			light.PointLight.Enabled = true
		end
		for i, cable in ipairs(lightCables:GetChildren()) do
			cable.Enabled = true
		end
	end
	Lib.btnFuncs[8] = function()
		Lib.Script.moveWater(weakWall1, Vector3.new(0, -17, 0), 1, true)
		weakWall1.ExplosionSound:Play()

		wait(3)
		loosePlatform1.Anchored = false
		loosePlatform1.BreakSound:Play()
	end
	autoEvents[#autoEvents + 1] = function()
		Lib.Script.setWaterState(water2, "lava")
		Lib.Script.moveWater(water2, Vector3.new(0, 80, 0), 17, true)
		wait(17)
	end
	Lib.btnFuncs[9] = function()
		local platform = climbPlatforms.MotorizedPlatform
		Lib.Script.moveWater(platform, Vector3.new(0, -6, 0), 3, true)
		platform.MotorSound:Play()
		delay(3, function()
			platform.MotorSound:Stop()
		end)

		wait(3.5)
		loosePlatform2.Anchored = false
		loosePlatform2.BreakSound:Play()
	end
	Lib.btnFuncs[10] = function()
		Lib.Script.moveWater(weakWall2, Vector3.new(0, -17, 0), 1, true)
		weakWall2.ExplosionSound:Play()
	end
	autoEvents[#autoEvents + 1] = function()
		-- Break the platforms.
		for i, item in ipairs(climbPlatforms:GetDescendants()) do
			if item:IsA("BasePart") then
				item.Anchored = false
			end
		end
		climbPlatforms:BreakJoints()
		climbPlatforms.BreakSoundPart.BreakSound:Play()

		Lib.Script.moveWater(water2, Vector3.new(0, 2, 0), 6, true)
		wait(6)

		-- Flood the remaining area.
		doorSeal.CFrame = doorSeal.CFrame * CFrame.new(0, 7, 0)
		Lib.Script.moveWater(doorSeal, Vector3.new(0, 9, 0), 1, true)
		Lib.Script.moveWater(water2, Vector3.new(0, 16 - 2, 0), 2, true)
		wait(2)
	end
end
