Hi, so i’m trying to make a custom shiftlock controller, but since shiftlock is toggleable, i want to replicate that in my script.
Here is my code:
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if gameProcessedEvent then return false end
if input.KeyCode == Enum.KeyCode.LeftShift or input.KeyCode == Enum.KeyCode.RightShift then
Humanoid.CameraOffset = Vector3.new(1.5, 0, 0)
UserSettings().GameSettings.RotationType = Enum.RotationType.CameraRelative
end
end)
This is a script inside of StarterPlayerScripts.
Help appreciated.