How to disable roblox's Shift Lock

Im making a game and i wanna make sprint, shift will be run hotkey but howewer roblox has shift lock… There is a way to disable it?

24 Likes

Shift Lock can be disabled through the following steps:

  1. Select the StarterPlayer Service in Roblox Studio’s Explorer
  2. Look for the “Controls” section in the Properties widget
  3. Uncheck the box for the EnableMouseLockOption property

Alternative Video Walkthrough

What if “EnableMouseLockOption” isn’t there?

On May 19th, 2023, the “EnableMouseLockOption” property was deprecated and it became inaccessible via the Properties window. Although Roblox has reverted this change as of June 2023, it’s likely that “EnableMouseLockOption” will be deprecated again in the future and replaced with a new feature.

If it’s removed again before a suitable replacement has been added, EnableMouseLockOption should still be able to be updated via the Command Bar. Here’s an example of the code that you would input into the Command Bar to enable or disable the property:

local StarterPlayer = game:GetService("StarterPlayer")

-- Choose from one of these and delete the other depending on what you want
StarterPlayer.EnableMouseLockOption = true -- Enables the property
StarterPlayer.EnableMouseLockOption = false -- Disables the property

Once an official replacement for the property has been introduced, I’ll update this post with relevant information about that so you’ll know how the newer and supported method of turning off Shift Lock works. For now, here’s what Roblox Staff has mentioned:


(Option 2) Enabling / Disabling Shift Lock via Scripts

If you want to enable or disable the property per player while the game is running (allowing you to choose when all players / specific players are allowed to press the shift key to turn it on or off), you can toggle the DevEnableMouseLock property of the Player Instance via a server script. Here’s an example:

local Players = game:GetService("Players")

local part = workspace.Part
part.Touched:Connect(function(hit) -- Whenever something touches the object in the Workspace called "Part"
	local Character = hit:FindFirstAncestorWhichIsA("Model") -- Looks for the Character model
	local Player = Players:GetPlayerFromCharacter(Character) -- Checks if a player can be retrieved from the model (so we know a player touched the Part and not an NPC)
	
	if Character and Player then -- If a model was found and it was a player's Character, then...
		Player.DevEnableMouseLock = false -- The player will no longer be able to toggle shift lock
-- Update "false" to "true" if you want to allow the player to toggle shift lock, instead
	end
end)

*Note: If a player already had shift lock turned on when this happens, they won’t be able to turn it off until the DevEnableMouseLock property is enabled again.

Video Example


For future reference, use the search feature of the Developer Forum before posting a question to see if there’s an existing solution. At the time you posted your question, it was already answered on another topic:

42 Likes

There are already free models about this just search Disable Shiftlock

4 Likes

You could have searched around before posting. But go to starter player and disable this:

image

EnableMouseLockOption should be unticked

25 Likes

Well will it disable First Person as shiftlock right?

2 Likes

I don’t understand your question. The property just makes it so you can’t turn on shift lock.

2 Likes

lol sorry for it i didnt search actually and thx

3 Likes

Just search up Disable shift lock in the toolbox and learn the script. Also check for hidden viruses

3 Likes

I just asked if it disables first person

2 Likes

No, it does not. Otherwise if it did, it would be in the property name.

2 Likes

You would not need to do this as there’s already a built-in method into ROBLOX Studio that allows you to disable ShiftLock.

This would disable ShiftLock entirely, no matter if you are in first person or not. Players can still go into First Person, though.

2 Likes

Ok thanks for that info I didn’t know that

3 Likes

To disable shift lock in your game please create a script in your Workspace folder and paste this script in:

game.StarterPlayer.EnableMouseLockOption = false

6 Likes

thanks i been finding this for ages, why do they gotta deprecate it, is just makes this annoying

1 Like

they rolled the update back fortunately

1 Like