LOADING...

Centered Shift Lock Universal

198 VISUALIZAÇÕES
28/01/2026
Universal
Centered Shift Lock Universal
AUTOR
avatarBrezikk
AVALIAÇÃO DOS USUÁRIOS
100%APROVAÇÃO
TESTADO COM

Descrição

This script modifies the Shift Lock behavior so that, instead of offsetting the camera to the side, it keeps the camera centered on the character. The camera centering can be toggled on or off using the Caps Lock key. Please note that this script may not function in some games due to anti-cheat systems or game-specific restrictions that prevent this type of camera modification.

JOGOS SUPORTADOS

Script Universal

Funciona na maioria dos jogos

Código do Script
1local UserInputService = game:GetService("UserInputService")
2local RunService = game:GetService("RunService")
3local Players = game:GetService("Players")
4
5local player = Players.LocalPlayer
6local mouse = player:GetMouse()
7local camera = workspace.CurrentCamera
8local isLocked = false
9
10-- Settings
11local SHIFT_LOCK_ICON = "rbxasset://textures/MouseLockedCursor.png"
12local DEFAULT_ICON = ""
13local TOGGLE_KEY = Enum.KeyCode.CapsLock -- Keybind set to Caps Lock
14
15local function toggleShiftLock()
16    isLocked = not isLocked
17    
18    if isLocked then
19        -- ENABLE: Shows lock icon and forces the mouse to the exact center
20        mouse.Icon = SHIFT_LOCK_ICON
21        
22        RunService:BindToRenderStep("ForceCentralLock", Enum.RenderPriority.Last.Value, function()
23            local character = player.Character
24            if character and character:FindFirstChild("HumanoidRootPart") and character:FindFirstChild("Humanoid") then
25                -- Forces the mouse to the center of the screen
26                UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
27                
28                -- Aligns the character with the camera (no side offset)
29                local _, y = camera.CFrame.Rotation:ToEulerAnglesYXZ()
30                character.HumanoidRootPart.CFrame =
31                    CFrame.new(character.HumanoidRootPart.Position) * CFrame.Angles(0, y, 0)
32                
33                -- Removes Roblox's default shoulder camera offset
34                character.Humanoid.CameraOffset = Vector3.new(0, 0, 0)
35                character.Humanoid.AutoRotate = false
36            end
37        end)
38    else
39        -- DISABLE: Releases the mouse and restores default behavior
40        RunService:UnbindFromRenderStep("ForceCentralLock")
41        UserInputService.MouseBehavior = Enum.MouseBehavior.Default
42        mouse.Icon = DEFAULT_ICON
43        
44        local character = player.Character
45        if character and character:FindFirstChild("Humanoid") then
46            character.Humanoid.AutoRotate = true
47            character.Humanoid.CameraOffset = Vector3.new(0, 0, 0)
48        end
49    end
50end
51
52-- Detects when Caps Lock (or a side button mapped to Caps Lock) is pressed
53UserInputService.InputBegan:Connect(function(input, gameProcessed)
54    if gameProcessed then return end
55    if input.KeyCode == TOGGLE_KEY then
56        toggleShiftLock()
57    end
58end)

ScriptHUB

O melhor site para procurar, compartilhar e achar os melhores scripts com máxima segurança e desempenho.

© 2026 ScriptHub. Todos os direitos reservados.
ScriptHUB