local function B()local B={}local f=game.Workspace:WaitForChild("\070\108\097\103\083\116\097\110\100")if not f then table.insert(B,Vector3.new(0,50,0))else for f,e in ipairs(game.Workspace:GetChildren())do if e.Name=="\070\108\097\103\083\116\097\110\100"then table.insert(B,e.FlagStand.Position)end end end local e=B[math.random(#B)]Camera.CameraType=Enum.CameraType.Scriptable Camera.Focus=CFrame.new(e)Player:RequestStreamAroundAsync(e)local L=0 game.Lighting.Blur.Enabled=true RunService:BindToRenderStep("\073\110\116\101\114\109\105\115\115\105\111\110\082\111\116\097\116\101",Enum.RenderPriority.Camera.Value,function()local B=e+Vector3.new(50*math.cos(L),20,50*math.sin(L))Camera.CoordinateFrame=CFrame.new(B,e)L=L+math.rad(.25)end)end local function f()game.Lighting.Blur.Enabled=false RunService:UnbindFromRenderStep("\073\110\116\101\114\109\105\115\115\105\111\110\082\111\116\097\116\101")Camera.CameraType=Enum.CameraType.Custom end local function e(e)if e and not InIntermission then InIntermission=true B()end if not e and InIntermission then InIntermission=false f()end end


local function StartIntermission()
	local possiblePoints = {}
	
	-- Wait for a flag to circle around.
	local flagstand = game.Workspace:WaitForChild("FlagStand")
	
	-- If no flags were present, use the center of the map as the focal point.
	if not flagstand then
		table.insert(possiblePoints, Vector3.new(0,50,0))
	else
		for _, child in ipairs(game.Workspace:GetChildren()) do
			if child.Name == "FlagStand" then
				table.insert(possiblePoints, child.FlagStand.Position)
			end
		end
	end
	
	local focalPoint = possiblePoints[math.random(#possiblePoints)]
	Camera.CameraType = Enum.CameraType.Scriptable
	Camera.Focus = CFrame.new(focalPoint)
	
	-- Stream in the area around the focal point.
	Player:RequestStreamAroundAsync(focalPoint)

	local angle = 0
	game.Lighting.Blur.Enabled = true
	RunService:BindToRenderStep('IntermissionRotate', Enum.RenderPriority.Camera.Value, function()
		local cameraPosition = focalPoint + Vector3.new(50 * math.cos(angle), 20, 50 * math.sin(angle))
		Camera.CoordinateFrame = CFrame.new(cameraPosition, focalPoint)
		angle = angle + math.rad(.25)
	end)	
end

local function StopIntermission()
	game.Lighting.Blur.Enabled = false
	RunService:UnbindFromRenderStep('IntermissionRotate')
	Camera.CameraType = Enum.CameraType.Custom
end

local function OnDisplayIntermission(display)
	if display and not InIntermission then
		InIntermission = true
		StartIntermission()
	end	
	if not display and InIntermission then
		InIntermission = false
		StopIntermission()
	end
end
