-- DEV AIM ASSIST (LEGIT)
-- Fully improved: PC + Mobile + Team + Death + Visibility + Accurate at any distance
-- U = ON | I = OFF
local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local player = Players.LocalPlayer
local camera = workspace.CurrentCamera
local enabled = false
local MAX_DISTANCE = 1000 -- max distance to target
local BASE_SMOOTHNESS = 0.15 -- camera lerp speed
local STICK_TIME = 0.25 -- stick to current target briefly
local currentTarget = nil
local lastTargetTime = 0
-- =====================
-- UI
-- =====================
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "AimAssistUI"
ScreenGui.Parent = player:WaitForChild("PlayerGui")
local ToggleButton = Instance.new("TextButton")
ToggleButton.Size = UDim2.new(0, 160, 0, 50)
ToggleButton.Position = UDim2.new(0.5, -80, 0.9, -25)
ToggleButton.AnchorPoint = Vector2.new(0.5, 0.5)
ToggleButton.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
ToggleButton.Text = "Aim Assist: OFF"
ToggleButton.Parent = ScreenGui
ToggleButton.MouseButton1Click:Connect(function()
enabled = not enabled
ToggleButton.Text = "Aim Assist: " .. (enabled and "ON" or "OFF")
end)
-- =====================
-- KEYBINDS
-- =====================
UserInputService.InputBegan:Connect(function(input, gpe)
if gpe then return end
if input.KeyCode == Enum.KeyCode.U then
enabled = true
ToggleButton.Text = "Aim Assist: ON"
elseif input.KeyCode == Enum.KeyCode.I then
enabled = false
ToggleButton.Text = "Aim Assist: OFF"
end
end)
-- =====================
-- HELPER FUNCTIONS
-- =====================
-- Returns the best body part to aim at
local function getAimPoint(character)
return character:FindFirstChild("UpperTorso")
or character:FindFirstChild("Torso")
or character:FindFirstChild("Head")
end
-- Returns true if target is visible (no walls)
local function isVisible(targetPart)
local origin = camera.CFrame.Position
local direction = targetPart.Position - origin
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Blacklist
params.FilterDescendantsInstances = {player.Character}
params.IgnoreWater = true
local result = workspace:Raycast(origin, direction, params)
-- Visible if ray hits target itself or nothing
return not result or result.Instance:IsDescendantOf(targetPart.Parent)
end
-- Returns the best target based on distance and visibility
local function getBestTarget()
local bestTarget = nil
local closestDistance = MAX_DISTANCE
for _, plr in ipairs(Players:GetPlayers()) do
if plr ~= player
and plr.Team ~= player.Team
and plr.Character then
local humanoid = plr.Character:FindFirstChildOfClass("Humanoid")
local aimPart = getAimPoint(plr.Character)
if humanoid and humanoid.Health > 0 and aimPart and isVisible(aimPart) then
local distance = (aimPart.Position - camera.CFrame.Position).Magnitude
if distance < closestDistance then
closestDistance = distance
bestTarget = aimPart
end
end
end
end
return bestTarget
end
-- =====================
-- CAMERA ASSIST
-- =====================
RunService.RenderStepped:Connect(function()
if not enabled then
currentTarget = nil
return
end
-- Stick to current target briefly
if currentTarget and tick() - lastTargetTime < STICK_TIME then
if not currentTarget.Parent then
currentTarget = nil
end
else
currentTarget = getBestTarget()
lastTargetTime = tick()
end
if not currentTarget then return end
-- Smoothly rotate camera toward target
local desiredCF = CFrame.new(camera.CFrame.Position, currentTarget.Position)
camera.CFrame = camera.CFrame:Lerp(desiredCF, BASE_SMOOTHNESS)
end)
To embed this project on your website, copy the following code and paste it into your website's HTML: