How can I Enable Shift Lock Forcefully?

I have looked all over and can’t find a good tutorial from recently about this.
I would like it when you click a button Ex

key.KeyCode== Enum.KeyCode.ButtonL2 -- Xbox Left Button 2

Do I need to fire a function?
Please let me know ASAP

1 Like

I don’t know what you need help with, can you explain some more? Are you familiar with Context Action Service?

Im pretty sure you might want to make your own shift lock system to do this, all you really need to do is use some mouse functions and run service to lock the mouse in the middle of the screen and then make the players camera cframe their heads + some offset

1 Like

No Not like that For Example like how Dungeon Quest has it where if you have a game pad connected and when you start the level and when you Click Enum.KeyCode
.ButtonL2 it is the same as you holding shift o activate shift lock

1 Like

Found Out How to do it while looking Deeply at Roblox modules.
Use this reply for reference if you need something like this.

First, Go into game in studio go into your player then go into Player Scripts You will find Player Module You will need to Copy That.
End that test session and paste it into this directory
game.StarterPlayer.StarterPlayerScripts
Paste it there Go into CameraModule and Find the First child of that called “MouseLockController”
Go into the script down to line 28 where you set the keys on what you wan to bind it to.
It should say

	self.boundKeys = {Enum.KeyCode.LeftShift, Enum.KeyCode.RightShift} -- defaults

When you want to add more add a comma and then add you key Bind I did Left trigger on Xbox Controller

	self.boundKeys = {Enum.KeyCode.LeftShift, Enum.KeyCode.RightShift,Enum.KeyCode.ButtonL2} -- defaults

Next, you Need to go down to line 41 and add that other keybind to the list.
It Should Say

boundKeysObj.Value = "LeftShift,RightShift"

Then you add a comma and add what button you want In this case again the Left trigger on an Xbox Controller.

boundKeysObj.Value = "LeftShift,RightShift,ButtonL2"

Finally There is a String value Called “BoundKeys” under the Script It should say this by default.
LeftShift,RightShift
Again you need to add a comma after the Defaults and type the key. Again using Xbox Controller Left trigger.
LeftShift,RightShift,ButtonL2
And we are Done.
Thanks For Reading This
Also covered it In this article

Shift lock Article

2 Likes