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.