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 N={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 k=900000 local z=false local L=CFrame.new(1.7,0,0)local l=CFrame.new(-1.7,0,0)local function K(k)button.Image=N[k]end local function w(N,z)return CFrame.new(root.Position,Vector3.new(z.CFrame.LookVector.X*k,root.Position.Y,z.CFrame.LookVector.Z*k))end local function s()UserInputService.MouseBehavior=Enum.MouseBehavior.LockCenter humanoid.AutoRotate=false K("\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=w(root,camera)camera.CFrame=camera.CFrame*L else end end local function M()UserInputService.MouseBehavior=Enum.MouseBehavior.Default humanoid.AutoRotate=true K("\079\070\070")camera.CFrame=camera.CFrame*l pcall(function()z:Disconnect()z=nil end)end K("\079\070\070")z=false function ShiftLock()if not z then z=runservice.RenderStepped:Connect(function()s()end)else M()end end local O=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 z then z=runservice.RenderStepped:Connect(function()s()end)else M()end end)return MobileCameraFramework

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
