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?
Shift Lock can be disabled through the following steps:
- Select the
StarterPlayerService in Roblox Studio’s Explorer
- Look for the “Controls” section in the Properties widget
- Uncheck the box for the
Alternative Video Walkthrough
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:
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.
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:
There are already free models about this just search
You could have searched around before posting. But go to starter player and disable this:
EnableMouseLockOption should be unticked
Well will it disable First Person as shiftlock right?
I don’t understand your question. The property just makes it so you can’t turn on shift lock.
lol sorry for it i didnt search actually and thx
Just search up Disable shift lock in the toolbox and learn the script. Also check for hidden viruses
I just asked if it disables first person
No, it does not. Otherwise if it did, it would be in the property name.
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.
Ok thanks for that info I didn’t know that
To disable shift lock in your game please create a script in your Workspace folder and paste this script in:
game.StarterPlayer.EnableMouseLockOption = false
thanks i been finding this for ages, why do they gotta deprecate it, is just makes this annoying
they rolled the update back fortunately