
3.6k Views
1.0k Executions
Universal Head Lock On Script
Universal Script 📌
YoriScriptsFirst script
1 year ago
Please login to perform these actions:Does it work?
No reports yetNo reports yet. Tried it? Be the first to say.
Also noticed:
Description
Locks On To Players Head Works In Any Game On Roblox
-- Head Lock-On System (Client-Side)
-- Keybind: X to toggle
local UIS = game:GetService("UserInputService")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local LocalPlayer = Players.LocalPlayer
local Mouse = LocalPlayer:GetMouse()
local targetLock = false
local lockedPlayer = nil
local function getClosestPlayer()
local closest = nil
local shortestDist = math.huge
for _, player in pairs(Players:GetPlayers()) do
if player ~= LocalPlayer and player.Character then
local head = player.Character:FindFirstChild("Head")
if head then
local screenPos = workspace.CurrentCamera:WorldToScreenPoint(head.Position)
local mousePos = Vector2.new(Mouse.X, Mouse.Y)
local distance = (mousePos - Vector2.new(screenPos.X, screenPos.Y)).Magnitude
if distance < shortestDist then
shortestDist = distance
closest = player
end
end
end
end
return closest
end
local function lockOn()
local target = getClosestPlayer()
if target and target.Character then
local head = target.Character:FindFirstChild("Head")
if head then








it supa great! i used it in fng with rtimpact fruit
works great for rivals
@gav1010101010 That's nice
Enjoy The Script!