uis=game:GetService("\085\115\101\114\073\110\112\117\116\083\101\114\118\105\099\101")ismobile=uis.TouchEnabled button.Visible=ismobile local k={OFF="\114\098\120\097\115\115\101\116\058\047\047\116\101\120\116\117\114\101\115\047\117\105\047\109\111\117\115\101\076\111\099\107\095\111\102\102\064\050\120\046\112\110\103",ON="\114\098\120\097\115\115\101\116\058\047\047\116\101\120\116\117\114\101\115\047\117\105\047\109\111\117\115\101\076\111\099\107\095\111\110\064\050\120\046\112\110\103"}local t=900000 local i=false local r=CFrame.new(1.7,0,0)local y=CFrame.new(-1.7,0,0)local function M(t)button.Image=k[t]end local function P(k,i)return CFrame.new(root.Position,Vector3.new(i.CFrame.LookVector.X*t,root.Position.Y,i.CFrame.LookVector.Z*t))end local function v()UserInputService.MouseBehavior=Enum.MouseBehavior.LockCenter humanoid.AutoRotate=false M("\079\078")if humanoid:GetState()~=Enum.HumanoidStateType.PlatformStanding and(humanoid:GetState()~=Enum.HumanoidStateType.Swimming and(humanoid.Health>0 and(Settings.Downed.Value==false and Settings.Ragdoll.Value==false)))then root.CFrame=P(root,camera)camera.CFrame=camera.CFrame*r else end end local function F()UserInputService.MouseBehavior=Enum.MouseBehavior.Default humanoid.AutoRotate=true M("\079\070\070")camera.CFrame=camera.CFrame*y pcall(function()i:Disconnect()i=nil end)end M("\079\070\070")i=false function ShiftLock()if not i then i=runservice.RenderStepped:Connect(function()v()end)else F()end end local g=CAS:BindAction("\083\104\105\102\116\076\079\067\075",ShiftLock,false,"\079\110")CAS:SetPosition("\083\104\105\102\116\076\079\067\075",UDim2.new(.8,0,.8,0))button.MouseButton1Click:Connect(function()if not i then i=runservice.RenderStepped:Connect(function()v()end)else F()end end)return MobileCameraFramework
--Visiblity
uis = game:GetService("UserInputService")
ismobile = uis.TouchEnabled
button.Visible = ismobile

local states = {
	OFF = "rbxasset://textures/ui/mouseLock_off@2x.png",
	ON = "rbxasset://textures/ui/mouseLock_on@2x.png",
}
local MAX_LENGTH = 900000
local active = false
local ENABLED_OFFSET = CFrame.new(1.7, 0, 0)
local DISABLED_OFFSET = CFrame.new(-1.7, 0, 0)
local function UpdateImage(STATE)
	button.Image = states[STATE]
end

local function GetUpdatedCameraCFrame(ROOT, CAMERA)
	return CFrame.new(
		root.Position,
		Vector3.new(CAMERA.CFrame.LookVector.X * MAX_LENGTH, root.Position.Y, CAMERA.CFrame.LookVector.Z * MAX_LENGTH)
	)
end
local function EnableShiftlock()
	UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
	humanoid.AutoRotate = false

	UpdateImage("ON")
	if
		humanoid:GetState() ~= Enum.HumanoidStateType.PlatformStanding
		and humanoid:GetState() ~= Enum.HumanoidStateType.Swimming
		and humanoid.Health > 0
		and Settings.Downed.Value == false
		and Settings.Ragdoll.Value == false
	then
		root.CFrame = GetUpdatedCameraCFrame(root, camera)
		camera.CFrame = camera.CFrame * ENABLED_OFFSET
	else
	end
end
local function DisableShiftlock()
	UserInputService.MouseBehavior = Enum.MouseBehavior.Default
	humanoid.AutoRotate = true
	UpdateImage("OFF")
	camera.CFrame = camera.CFrame * DISABLED_OFFSET
	pcall(function()
		active:Disconnect()
		active = nil
	end)
end
UpdateImage("OFF")
active = false
function ShiftLock()
	if not active then
		active = runservice.RenderStepped:Connect(function()
			EnableShiftlock()
		end)
	else
		DisableShiftlock()
	end
end
local ShiftLockButton = CAS:BindAction("ShiftLOCK", ShiftLock, false, "On")
CAS:SetPosition("ShiftLOCK", UDim2.new(0.8, 0, 0.8, 0))
button.MouseButton1Click:Connect(function()
	if not active then
		active = runservice.RenderStepped:Connect(function()
			EnableShiftlock()
		end)
	else
		DisableShiftlock()
	end
end)
return MobileCameraFramework
