local g=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local w=game:GetService("\082\117\110\083\101\114\118\105\099\101")local v=Instance.new("\080\097\114\116")v.Position=Vector3.new(0,0,0)local A=v local C=workspace.CurrentCamera C.CameraType=Enum.CameraType.Scriptable local Q=Instance.new("\078\117\109\098\101\114\086\097\108\117\101")local t=false local c=Vector3.new(120,43,-40)local U=15 local B=360 local S=-1 local T=true local R={}R.__index=R function R.blur(g)local w=Instance.new("\066\108\117\114\069\102\102\101\099\116")w.Parent=C w.Size=32 g.blurEffect=w end function R.unblur(g)g.blurEffect:Destroy()end function R.updateCamera(g)if not A then return end C.Focus=A.CFrame local w=CFrame.Angles(0,math.rad(Q.Value),0)w=CFrame.new(A.Position)*w C.CFrame=w:ToWorldSpace(CFrame.new(c))if T==true then C.CFrame=CFrame.new(C.CFrame.Position,A.Position)end end function R.start(v)v:blur()local A=TweenInfo.new(U,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,S)local C=g:Create(Q,A,{Value=B})C.Completed:Connect(function()t=true end)C:Play()v.connection=w.RenderStepped:Connect(function()if t==false then v:updateCamera()end end)end function R.stop(g)g.connection:disconnect()g:unblur()end return R
local TweenService = game:GetService('TweenService')

local RunService = game:GetService('RunService')

local newBlock = Instance.new('Part')
newBlock.Position = Vector3.new(0, 0, 0)
local target = newBlock
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
local rotationAngle = Instance.new('NumberValue')
local tweenComplete = false

local cameraOffset = Vector3.new(120, 43, -40)
local rotationTime = 15 -- Time in seconds
local rotationDegrees = 360
local rotationRepeatCount = -1 -- Use -1 for infinite repeats
local lookAtTarget = true -- Whether the camera tilts to point directly at the target
local RotateCamera = {}

RotateCamera.__index = RotateCamera

function RotateCamera:blur()
	local blurEffect = Instance.new('BlurEffect')
	blurEffect.Parent = camera
	blurEffect.Size = 32
	self.blurEffect = blurEffect
end
function RotateCamera:unblur()
	self.blurEffect:Destroy()
end

function RotateCamera:updateCamera()
	if not target then return end
	camera.Focus = target.CFrame
	local rotatedCFrame = CFrame.Angles(0, math.rad(rotationAngle.Value), 0)
	rotatedCFrame = CFrame.new(target.Position) * rotatedCFrame
	camera.CFrame = rotatedCFrame:ToWorldSpace(CFrame.new(cameraOffset))
	if lookAtTarget == true then
		camera.CFrame = CFrame.new(camera.CFrame.Position, target.Position)
	end
end

function RotateCamera:start()
	self:blur()
	-- Set up and start rotation tween
	local tweenInfo =
		TweenInfo.new(
			rotationTime,
			Enum.EasingStyle.Linear,
			Enum.EasingDirection.InOut,
			rotationRepeatCount
		)
	local tween = TweenService:Create(rotationAngle, tweenInfo, { Value = rotationDegrees })

	tween.Completed:Connect(function()
		tweenComplete = true
	end)

	tween:Play()

	-- Update camera position while tween runs
	self.connection = RunService.RenderStepped:Connect(function()
		if tweenComplete == false then
			self:updateCamera()
		end
	end)
end

function RotateCamera:stop()
	self.connection:disconnect()
	self:unblur()
end

return RotateCamera