How to force shiftlock on?

How do you force shiftlock on without it being able to be turned off? Possibly with a script or option?

This may help

Forcing Shiftlock - Resources / Community Tutorials - DevForum | Roblox

Found this online, How to Force Enable Shift-Lock (Without changing the PlayerModule)

1 Like

here’s a script to do so

--Local script in StarterPlayerCharacter
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local plr = game:GetService("Players").LocalPlayer
local char = script.Parent
local hum = char:WaitForChild("Humanoid")
local root = hum.RootPart -- The HumanoidRootPart

--Toggle Function:
function shiftLock(active) --Toggle shift.lock function
	if active then		
		hum.CameraOffset =,0,0) -- I assume this is about the right camera offset.
		hum.AutoRotate = false --Disable the automatic rotation since we are the ones setting it.

		RunService:BindToRenderStep("ShiftLock", Enum.RenderPriority.Character.Value, function()
			UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter --Set the mouse to center every frame.

			local _, y = workspace.CurrentCamera.CFrame.Rotation:ToEulerAnglesYXZ() --Get the angles of the camera
			root.CFrame = * CFrame.Angles(0,y,0) --Set the root part to the camera's rotation
		hum.AutoRotate = true --Let the humanoid handle the camera rotations again.
		hum.CameraOffset =,0,0) --Move the camera back to normal.
		RunService:UnbindFromRenderStep("ShiftLock") -- Allow mouse to move freely.
		UserInputService.MouseBehavior = Enum.MouseBehavior.Default -- Let the mouse move freely
--Disable and Enable:
shiftLock(true) -- Toggle shift lock
print("Shift lock turned on!")

shiftLock(false) --Toggle off shift Lock
print("Shift lock turned off!")
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.