local SHIFTLOCK = game:GetService("ReplicatedStorage"):WaitForChild("SHIFTLOCK")
local UIS = game:GetService("UserInputService")
local smoothshiftlock = require(game:WaitForChild("StarterPlayer"):WaitForChild("StarterPlayerScripts"):WaitForChild("CustomShiftLock"):WaitForChild("SmoothShiftLock"))
local CD = false
SHIFTLOCK.OnClientEvent:Connect(function(bool)
smoothshiftlock:ToggleShiftLock(false)
CD = bool
end)
UIS.InputBegan:Connect(function(input,gamepro)
if input.KeyCode == Enum.KeyCode.LeftControl or input.KeyCode == Enum.KeyCode.RightControl then
if CD == false then
smoothshiftlock:ToggleShiftLock(not smoothshiftlock:IsEnabled())
end
end
end)
When player press ctrl It’s kinda does the shiftlock thing but player didn’t rotate at the camera, It’s just the mouse that’s locked on screen
local ugs = UserSettings().GameSettings
local uis = game.UserInputService
local Camera = workspace.CurrentCamera
function enable()
ugs.RotationType = Enum.RotationType.CameraRelative
uis.MouseBehaviour = Enum.MouseBehaviour.LockCenter
Camera.CameraOffset = Vector3.new(1.75, 0, 0)
end
function disable()
ugs.RotationType = Enum.RotationType.MovementRelative
uis.MouseBehaviour = Enum.MouseBehaviour.Classic
Camera.CameraOffset = Vector3.new(0, 0, 0)
end
Sorry I’m in mobile so mistakes might happen. Also just use any crosshair (use learning documents if you don’t understand)
Don’t rely on modules for such simple thing. Also disable mouse lock option from starter player. This is literally what shoftlock does
Just use tween for smooth offset transform
CameraOffset is a property of the humanoid.
Besides, there’s nothing wrong with using SmoothShiftLock, or any module in general, as why should you go out of your way to recreate what already exists?
Anyways, this is quite unnecessary for something that’s already included in the module. All you have to do is add your desired inputs into the keybind configs inside of the SmoothShiftLock module.
--// Configuration
local Config = {
MOBILE_SUPPORT = false, --// Adds a button to toggle the shift lock for touchscreen devices
SMOOTH_CHARACTER_ROTATION = true, --// If your character should rotate smoothly or not
CHARACTER_ROTATION_SPEED = 3, --// How quickly character rotates smoothly
TRANSITION_SPRING_DAMPER = 0.75, --// Camera transition spring damper, test it out to see what works for you
CAMERA_TRANSITION_IN_SPEED = 15, --// How quickly locked camera moves to offset position
CAMERA_TRANSITION_OUT_SPEED = 25, --// How quickly locked camera moves back from offset position
LOCKED_CAMERA_OFFSET = Vector3.new(1.75, 0.5, 0), --// Locked camera offset
LOCKED_MOUSE_ICON = --// Locked mouse icon
"rbxassetid://14393179816",
SHIFT_LOCK_KEYBINDS = --// Shift lock keybinds
{ Enum.KeyCode.LeftShift, Enum.KeyCode.LeftControl } -- simply add your desired inputs here
};