Universal Script 📌
1.1k Views
142 Executions

Shift lock

Universal Script 📌
11 months ago
Get an executor
Please login to perform these actions:

Does it work?

No reports yet

No reports yet. Tried it? Be the first to say.

Also noticed:

Description

Shift lock

View Raw
local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")

local player = Players.LocalPlayer
local camera = workspace.CurrentCamera

local SHIFT_KEY = Enum.KeyCode.LeftShift
local OFFSET = Vector3.new(1.75, 0, 0)

local enabled = false
local humanoid

local function getHumanoid()
	local char = player.Character or player.CharacterAdded:Wait()
	humanoid = char:WaitForChild("Humanoid")
end

getHumanoid()
player.CharacterAdded:Connect(getHumanoid)

local function enableShiftLock()
	enabled = true
	UIS.MouseBehavior = Enum.MouseBehavior.LockCenter
	humanoid.AutoRotate = false
	humanoid.CameraOffset = OFFSET
end

local function disableShiftLock()
	enabled = false
	UIS.MouseBehavior = Enum.MouseBehavior.Default
	humanoid.AutoRotate = true
	humanoid.CameraOffset = Vector3.zero
end

UIS.InputBegan:Connect(function(input, gpe)
	if gpe then return end
	if input.KeyCode == SHIFT_KEY then
		if enabled then
			disableShiftLock()
		else


Comments

0
Log in to join the conversation. Login
No comments yet. Be the first!

More universal scripts

See all
Script hub
178.8k
1.7M
Bumped 4 hours ago
Key System
Universal Script 📌
9.1k
31.9k
Bumped 5 hours ago
Script hub
49.9k
12.4k
Bumped 6 hours ago
Key System
Paid
Script hub
5.5M
1.1M
Bumped 10 hours ago
Key System
Script hub
20.7k
4.0k
Bumped 11 hours ago
Key System
Paid
Universal Script 📌
753
231
Approved 17 hours ago
Universal Script 📌
657
2.9k
Approved 17 hours ago