[RANKED] Da Hood
7.3k Views
92 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

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
438
4 years ago
Key System
[RANKED] Da Hood
864.0k
536
4 years ago
Key System
[RANKED] Da Hood
288.8k
293
2 years ago
[RANKED] Da Hood
315.0k
191
3 years ago
[RANKED] Da Hood
66.5k
788
4 years ago
Key System
[RANKED] Da Hood
4.8k
285
4 years ago
Key System
Paid
[RANKED] Da Hood
43.0k
348
4 years ago
Key System