Universal Script 📌
193.7k Views
300 Executions

Shift lock

Universal Script 📌
Grindingonthagame
GrindingonthagameFirst script
3 years 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

Its kinda buggy but it works :)

View Raw
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local Camera = game.Workspace.CurrentCamera
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local PlayerMouse = LocalPlayer:GetMouse()
local shiftLockEnabled = false
local lockOffset = Vector2.new(5, 0)
local cursorImage = "rbxasset://textures/MouseLockedCursor.png"
local originalMouseIcon
local originalCameraOffset
local characterAddedConn, characterRemovingConn

local function disconnectAllConnections()
   if characterAddedConn then
       characterAddedConn:Disconnect()
       characterAddedConn = nil
   end
   if characterRemovingConn then
       characterRemovingConn:Disconnect()
       characterRemovingConn = nil
   end
end

local function toggleShiftLock()
   shiftLockEnabled = not shiftLockEnabled
   if shiftLockEnabled then
       UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
       originalMouseIcon = PlayerMouse.Icon
       PlayerMouse.Icon = cursorImage
   else
       UserInputService.MouseBehavior = Enum.MouseBehavior.Default
       PlayerMouse.Icon = originalMouseIcon
   end
end

local function updateCameraOffset()
   if shiftLockEnabled then
       local humanoid = LocalPlayer.Character:FindFirstChildOfClass("Humanoid")
       if humanoid then


Comments

1
Log in to join the conversation. Login
Rase_584's profile picture
Rase_5849 months ago

Chat gpt?

1

Tags

More universal scripts

See all
Script hub
6.9k
54.9k
Bumped 2 hours ago
Universal Script 📌
92
11
Approved 2 hours ago
Script hub
13.2k
63.3k
Bumped 2 hours ago
Script hub
2.5k
7.7k
Bumped 3 hours ago
Key System
Universal Script 📌
1.4k
5.7k
Bumped 3 hours ago