Universal Script 📌
193.8k Views
343 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 :)

Updates

  1. Script edited: Create script

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
119.4k
193.3k
Bumped 4 hours ago
Key System
Script hub
180.8k
1.8M
Bumped 5 hours ago
Key System
Universal Script 📌
1.1k
2.4k
Bumped 5 hours ago
Script hub
60.1k
242.8k
Bumped 5 hours ago
Key System
Universal Script 📌
6.1k
53.3k
Bumped 8 hours ago
Universal Script 📌
122.8k
877.7k
Bumped 8 hours ago
Script hub
6.4k
49.2k
Bumped 8 hours ago
Key System