Universal Aimlock
Key Required VerifiedUniversal

Universal Aimlock

Universal ScriptI92140I9I92140I9 6.5K views 2.1K executesUpdated Jan 1, 2026
3.3/ 5(3 votes)
2167% Positive
Lua Script•130 lines (2638 chars)
-- CHANGE YOUR KEYBIND HERE:

local KEYBIND = Enum.KeyCode.F

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local StarterGui = game:GetService("StarterGui")

local Aiming = false
local currentTarget = nil
local MAX_DISTANCE = 600

local toggleSound = Instance.new("Sound")
toggleSound.SoundId = "rbxassetid://12221967"
toggleSound.Volume = 1
toggleSound.Parent = player:WaitForChild("PlayerGui")

local function Notify(text)
	StarterGui:SetCore("SendNotification", {
		Title = "faven.lua",
		Text = text,
		Duration = 2
	})
end

local function IsTeammate(plr)
	if player.Team and plr.Team then
		return player.Team == plr.Team
	end
	return false
end

local function IsValidTarget(plr)
	if not plr
		or plr == player
		or IsTeammate(plr)
		or not plr.Character
		or not plr.Character:FindFirstChild("Humanoid")
		or not plr.Character:FindFirstChild("Head")
	then
		return false
	end

	local hum = plr.Character.Humanoid

	if hum.Health <= 0 then
		return false
	end

	if hum.Health == math.huge
		or hum.MaxHealth == math.huge
		or hum.Health > 1e6
		or hum.MaxHealth > 1e6
	then
		return false
	end

	if plr.Character:FindFirstChildOfClass("ForceField") then
		return false
	end

	return true
end

local function GetClosestToMouse()
	local closest = nil
	local shortest = math.huge
	local mousePos = mouse.Hit.p

	for _, plr in ipairs(game.Players:GetPlayers()) do
		if IsValidTarget(plr) then
			local head = plr.Character.Head
			local dist = (head.Position - mousePos).Magnitude

			if dist < shortest and dist <= MAX_DISTANCE then
				shortest = dist
				closest = plr
			end
		end
	end

	return closest
end

local function AimLock()
	currentTarget = GetClosestToMouse()

	if currentTarget and IsValidTarget(currentTarget) then
		local cam = workspace.CurrentCamera
		local camPos = cam.CFrame.Position
		local headPos = currentTarget.Character.Head.Position

		cam.CFrame = CFrame.new(camPos, headPos)
	end
end

UserInputService.InputBegan:Connect(function(input, gp)
	if gp then return end
	if input.KeyCode == KEYBIND then
		Aiming = not Aiming
		toggleSound:Play()

		if Aiming then
			Notify("Aimlock has been enabled")
		else
			Notify("Aimlock has been disabled")
			currentTarget = nil
		end
	end
end)

RunService.RenderStepped:Connect(function()
	if Aiming then
		AimLock()
	end
end)

game.Players.PlayerAdded:Connect(function()
	if Aiming then
		currentTarget = nil
	end
end)

game.Players.PlayerRemoving:Connect(function(plr)
	if plr == currentTarget then
		currentTarget = nil
	end
end)

Features & Information

Works In Most Games. Works First & Third-Person Aimlock Team Checks Forcefield Checks Inf Health Checks
#Aimbot#Aimlock

Community Comments (8)

niedzwiedz1223niedzwiedz1223Jan 3, 2026

how do i make this script to work

zezimburladorzezimburladorJan 4, 2026

doenst work

Replying to @zezimburlador
crash6230acrash6230aJan 9, 2026

@zezimburlador are u stuopid

Replying to @crash6230a
zezimburladorzezimburladorJan 15, 2026

@crash6230a no niga

Replying to @zezimburlador
crash6230acrash6230aJan 15, 2026

@zezimburlador u def r

Replying to @crash6230a
zezimburladorzezimburladorJan 16, 2026

@crash6230a ur def a israel guy

Replying to @zezimburlador
crash6230acrash6230aJan 16, 2026

@zezimburlador keep projecting tough guy

Replying to @zezimburlador
I92140I9I92140I9Jan 28, 2026

@zezimburlador doesn't work for every game due to games literally having different ways to shoot, but works for most games I've pla* so far. including Prison Life

More Scripts for Universal Scripts