[RANKED] Da Hood
7.3k Views
106 Executions

mouse lock

Da Hood
4 years ago
Please login to perform these actions:

mouse lock is a Da Hood script for Roblox, uploaded to ScriptBlox on Aug 2, 2022.

Does it work?

No reports yet

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

Also noticed:

Description

i hate mouse locks

Updates

  1. Script edited: Create script

View Raw
local MouseLock = {
    Settings = {
        Enabled = false,
        Key = 'q',
        Prediction = 0.1211,
        AimPart = 'HumanoidRootPart'
    }
}

local CurrentCamera = game:GetService("Workspace").CurrentCamera
local RunService = game:GetService("RunService")
local Mouse = game.Players.LocalPlayer:GetMouse()
local Plr

function FindClosestPlayer()
    local closestPlayer
    local shortestDistance = math.huge

    for i, v in pairs(game.Players:GetPlayers()) do
        if v ~= game.Players.LocalPlayer and v.Character and v.Character:FindFirstChild("Humanoid") and
            v.Character.Humanoid.Health ~= 0 and v.Character:FindFirstChild("HumanoidRootPart") then
            local pos = CurrentCamera:WorldToViewportPoint(v.Character.PrimaryPart.Position)
            local magnitude = (Vector2.new(pos.X, pos.Y) - Vector2.new(Mouse.X, Mouse.Y)).magnitude
            if magnitude < shortestDistance then
                closestPlayer = v
                shortestDistance = magnitude
            end
        end
    end
    return closestPlayer
end

Mouse.KeyDown:Connect(function(KeyPressed)
    if KeyPressed == (MouseLock.Settings.Key) then
        if MouseLock.Settings.Enabled == true then
            MouseLock.Settings.Enabled = false
            Plr = FindClosestPlayer()
        else
            Plr = FindClosestPlayer()
            MouseLock.Settings.Enabled = true


Comments

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

More Da Hood scripts

See all
[RANKED] Da Hood
1.2M
592
4 years ago
Key System
[RANKED] Da Hood
864.1k
690
4 years ago
Key System
[RANKED] Da Hood
288.9k
358
3 years ago
[RANKED] Da Hood
66.5k
917
4 years ago
Key System
[RANKED] Da Hood
4.9k
345
4 years ago
Key System
Paid
[RANKED] Da Hood
43.0k
397
4 years ago
Key System
[RANKED] Da Hood
28.3k
235
4 years ago
Key System