How to rebind shift lock?

So in my game, when you press shift you can sprint, but because it’s a obby type game I also want people to be able to use shift lock, I want to bind the shiftlock to F

The issue is that the stuff I’ve tried hasn’t worked

I tried this with userinputservice:

--Local script
UIS.InputBegan:Connect(function(input, gameProcessedEvent)
	if input.KeyCode == Enum.KeyCode.F then
		game.ReplicatedStorage.ShiftLock:FireServer()
	end
end)
--Server Script
game.ReplicatedStorage.ShiftLock.OnServerEvent:Connect(function(player)
	local ShiftLockOn = false
	if ShiftLockOn == false then
		ShiftLockOn = true
		game.Players.SpacialEthanRB.DevEnableMouseLock = true
	elseif ShiftLockOn == true then
		ShiftLockOn = false
		game.Players.SpacialEthanRB.DevEnableMouseLock = false
	end
end)

Am I changing the wrong property?

Thanks for reading.

A similar question has been asked before, and the answer was found. This is probably what you are looking for https://devforum.roblox.com/t/changing-shift-lock-keybind/337910

2 Likes

Oh, sorry, I searched before posting, but I didn’t find this, thank you.

1 Like