AimBot
Key RequiredUniversal

AimBot

Universal Scriptmichaelsafadi89michaelsafadi89 1.9K views 60 executesUpdated Aug 11, 2025
5.0/ 5(1 votes)
10100% Positive
Lua Script•150 lines (4945 chars)
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local runService = game:GetService("RunService")
local userInput = game:GetService("UserInputService")
local players = game:GetService("Players")

-- SETTINGS
local aimAssistRange = 1000         -- Max distance to aim
local toggleKey = Enum.KeyCode.E   -- Key to toggle aim assist

-- VARIABLES
local aimAssistEnabled = true
local priorityTarget = nil

-- GUI Setup for FOV circle (showing FOV even if 360° for consistency)
local playerGui = player:WaitForChild("PlayerGui")

local fovCircle = Instance.new("Frame")
fovCircle.Name = "AimAssistFOV"
fovCircle.Size = UDim2.new(0, 200, 0, 200)
fovCircle.Position = UDim2.new(0.5, -100, 0.5, -100)
fovCircle.BackgroundColor3 = Color3.new(1, 0, 0) -- Red when no target locked
fovCircle.BackgroundTransparency = 0.7
fovCircle.BorderSizePixel = 0
fovCircle.Visible = true
fovCircle.AnchorPoint = Vector2.new(0.5, 0.5)
fovCircle.Parent = playerGui

local uiCorner = Instance.new("UICorner")
uiCorner.CornerRadius = UDim.new(1, 0)
uiCorner.Parent = fovCircle

-- Toggle aim assist on/off
userInput.InputBegan:Connect(function(input, gameProcessed)
	if gameProcessed then return end
	if input.KeyCode == toggleKey then
		aimAssistEnabled = not aimAssistEnabled
		fovCircle.Visible = aimAssistEnabled
		print("Aim Assist: " .. (aimAssistEnabled and "ON" or "OFF"))
	end
end)

-- Find nearest visible enemy anywhere around player (360°) with line-of-sight
local function getNearestEnemy()
	local closestEnemy = nil
	local shortestDistance = aimAssistRange
	local camPos = camera.CFrame.Position

	for _, character in pairs(workspace:GetChildren()) do
		if character:FindFirstChild("Humanoid") 
		and character:FindFirstChild("HumanoidRootPart") 
		and character ~= player.Character then

			local enemyPlayer = players:GetPlayerFromCharacter(character)

			if enemyPlayer and enemyPlayer.Team ~= player.Team then
				local enemyPos = character.HumanoidRootPart.Position
				local distance = (enemyPos - camPos).Magnitude

				if distance < shortestDistance then
					-- Raycast to check line of sight (ignore player character)
					local raycastParams = RaycastParams.new()
					raycastParams.FilterDescendantsInstances = {player.Character}
					raycastParams.FilterType = Enum.RaycastFilterType.Blacklist

					local raycastResult = workspace:Raycast(camPos, (enemyPos - camPos).Unit * distance, raycastParams)

					if raycastResult and raycastResult.Instance:IsDescendantOf(character) then
						closestEnemy = character
						shortestDistance = distance
					end
				end
			end
		end
	end

	return closestEnemy
end

-- Listen for damage to player, set priorityTarget accordingly
local function onHealthChanged()
	local humanoid = player.Character and player.Character:FindFirstChildOfClass("Humanoid")
	if not humanoid then return end

	local lastHealth = humanoid.Health

	humanoid.HealthChanged:Connect(function(newHealth)
		if newHealth < lastHealth then
			-- Damage happened! Find who caused it
			-- We have no direct info on attacker here, so as a common approach,
			-- check recent attackers from workspace or use a tag system.
			-- For now, we'll try a basic approach:
			
			-- Find enemies within 50 studs who have a tool equipped (likely attacker)
			local camPos = camera.CFrame.Position
			for _, character in pairs(workspace:GetChildren()) do
				if character:FindFirstChild("Humanoid") and character:FindFirstChild("HumanoidRootPart") and character ~= player.Character then
					local enemyPlayer = players:GetPlayerFromCharacter(character)
					if enemyPlayer and enemyPlayer.Team ~= player.Team then
						local dist = (character.HumanoidRootPart.Position - camPos).Magnitude
						if dist <= 50 then
							-- Assume this enemy damaged player
							priorityTarget = character
							break
						end
					end
				end
			end
		end
		lastHealth = newHealth
	end)
end

-- Call it once on start and whenever character respawns
local function setupCharacterListener()
	if player.Character then
		onHealthChanged()
	end
	player.CharacterAdded:Connect(function()
		onHealthChanged()
	end)
end

setupCharacterListener()

-- Instantly snap camera to priority target if exists and alive, else snap to nearest enemy
local function adjustAim()
	if not aimAssistEnabled then return end

	-- Clear priority target if dead or nil
	if priorityTarget then
		local humanoid = priorityTarget:FindFirstChildOfClass("Humanoid")
		if not humanoid or humanoid.Health <= 0 then
			priorityTarget = nil
		end
	end

	local target = priorityTarget or getNearestEnemy()

	if target then
		local enemyPos = target.HumanoidRootPart.Position
		local camPos = camera.CFrame.Position
		camera.CFrame = CFrame.new(camPos, enemyPos)
		fovCircle.BackgroundColor3 = Color3.new(0, 1, 0) -- Green when locked
	else
		fovCircle.BackgroundColor3 = Color3.new(1, 0, 0) -- Red when no target
	end
end

runService.RenderStepped:Connect(adjustAim)

Features & Information

!READ! my first script but also it works almost only in arsenal so yeah also this was made by chatgpt and its pretty bad but you can use it if your looking for a fast aimbot (E to switch between using it or not using it)

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts