About Shiftlock?

of couse it wouldn’t, you’re in lockfirstperson. Only way to “ShiftLock” is an alternative in firstperson is getting Humanoid.CameraOffset on the client side and moving the X vector to 1.75

Example

-- //Services
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")

-- //TweenService
local TweenInfo = TweenInfo.new(0.25, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)

-- //Player
local player = Players.LocalPlayer

-- //Character
local character = player.Character or player.CharacterAdded:Wait()

-- //Humanoid
local Humanoid = character:FindFirstChild("Humanoid")

-- //Debounce
local Debounce = false

-- //Tweens
local TweenIn = TweenService:Create(Humanoid, TweenInfo, {CameraOffset = Vector3.new(1.75, 0, 0)})
local TweenOut = TweenService:Create(Humanoid, TweenInfo, {CameraOffset = Vector3.new(0, 0, 0)})

UserInputService.InputBegan:Connect(function(input: InputObject, gameProcessedEvent: boolean) 
	if input.KeyCode == Enum.KeyCode.LeftShift or input.KeyCode == Enum.KeyCode.RightShift then
		if not Debounce then
			-- //
			Debounce = true
			
			TweenIn:Play()
			TweenIn.Completed:Wait()
			
		else
			
			-- //
			Debounce = false
			
			TweenOut:Play()
			TweenOut.Completed:Wait()
			
		end
	end	
end)

This should work. Those buttons and the like are from a time when this did not exist.
https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://create.roblox.com/docs/reference/engine/classes/UserInputService/MouseBehavior&ved=2ahUKEwiN-d_Hn_KJAxWWhf0HHW4UMzEQFnoECCIQBQ&usg=AOvVaw0BV9FmAn_742m4imWssn2T
(currently I’m on mobile, and I can’t properly copy the link, but if it doesn’t work, put “roblox mouse move behaviour” in the search)

Since i think there is a confusion with the problem, I made a video showing what I’d like to be achieved:
description

Its a local script in starter gui

Update: i used localscript for the solution script and it actually worked, idk why i used server in the 1st place (when client scripts are for UIs) but it seems problem is solved

(to anyone who wants to have their problem solved)

1 Like