Universal Script 📌
24.9k Views
806 Executions

Head Aimlock Universal BEST IN FIRST PERSON

Universal Script 📌
2 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

Locks Players Curser to nearest players head

View Raw
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local LocalPlayer = Players.LocalPlayer

local cursorLocked = false
local connection

-- Create and set up the GUI
local gui = Instance.new("ScreenGui")
local textLabel = Instance.new("TextLabel")

gui.Name = "CursorLockGui"
gui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")

textLabel.Name = "LockStatusLabel"
textLabel.Parent = gui
textLabel.Text = "Cursor Unlocked"
textLabel.Size = UDim2.new(0, 200, 0, 50)
textLabel.Position = UDim2.new(0.5, -100, 0, 0)
textLabel.TextScaled = true
textLabel.BackgroundTransparency = 0.5
textLabel.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
textLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
textLabel.Visible = true

-- Function to find the closest player's head
local function findClosestPlayerHead()
    local closestPlayer = nil
    local closestDistance = math.huge

    for _, player in pairs(Players:GetPlayers()) do
        if player ~= LocalPlayer and player.Character and player.Character:FindFirstChild("Head") then
            local head = player.Character.Head
            local distance = (LocalPlayer.Character.Head.Position - head.Position).Magnitude
            if distance < closestDistance then
                closestDistance = distance
                closestPlayer = head
            end
        end


Comments

6
Log in to join the conversation. Login
marv's profile picture
marv2 years ago(edited)

yo this one works you right click on mouse to lock on to player and shoot i tested it in a first person shooter

2
Porshe's profile picture
Porshe2 years ago(edited)

How do I activate it

2
silly_'s profile picture
silly_2 years ago(edited)

works (Supports) solara :D

1
marv's profile picture
marv2 years ago(edited)

@maxmaster3602 yeah you could put it on a gui

1
maxmaster3602's profile picture
maxmaster3602Uploader2 years ago(edited)

Thanks for your great feedback marv shout i carry this script on maybe a GUI?

1
maxmaster3602's profile picture
maxmaster3602Uploader2 years ago(edited)

Right CLick

1