aimbot npc player v7
Key RequiredUniversal

aimbot npc player v7

Universal ScriptSodaAlexanderSodaAlexander 1.9K views 4.8K executesUpdated May 1, 2026
Unrated
00
Lua Script•708 lines (27060 chars)
if not game:GetService("RunService"):IsClient() then return end

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Camera = workspace.CurrentCamera
local LocalPlayer = Players.LocalPlayer

-- SETTINGS
local Settings = {
    Enabled = false,
    Mode = "Aimlock",
    TargetMode = "NPC",
    AimPartMode = "Auto",
    BulletSpeed = 300,
    PredictionStrength = 1,
    GravityEnabled = false,
    GravityStrength = 196.2,
    AimRadius = 150,
    ShowRadius = true,
    WallCheck = true,
    WallCheckStrength = "High",
    AimbotSmoothing = 0.3,
    AntiLag = true,
    StrongAntiLag = true, -- CHỈ QUÉT KHI CÓ TARGET, CHỈ QUÉT 1 NGƯỜI
}

-- UI
local Gui = Instance.new("ScreenGui", game.CoreGui)
Gui.Name = "AimSystemGui"
Gui.ResetOnSpawn = false

local function createDraggableButton(name, size, position, text)
    local frame = Instance.new("Frame", Gui)
    frame.Name = name
    frame.Size = size
    frame.Position = position
    frame.BackgroundColor3 = Color3.fromRGB(25,25,25)
    frame.BorderSizePixel = 0
    frame.Active = true
    local corner = Instance.new("UICorner", frame)
    corner.CornerRadius = UDim.new(0,12)
    local label = Instance.new("TextLabel", frame)
    label.Size = UDim2.new(1,0,1,0)
    label.BackgroundTransparency = 1
    label.Text = text
    label.TextColor3 = Color3.new(1,1,1)
    label.TextScaled = true
    label.Font = Enum.Font.GothamBold
    local dragging = false
    local dragInput
    local dragStart
    local startPos
    local moved = false
    frame.InputBegan:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then
            dragging = true
            dragInput = input
            dragStart = input.Position
            startPos = frame.Position
            moved = false
        end
    end)
    frame.InputChanged:Connect(function(input)
        if input == dragInput and dragging then
            local delta = input.Position - dragStart
            if math.abs(delta.X) > 5 or math.abs(delta.Y) > 5 then
                moved = true
            end
            frame.Position = UDim2.new(
                startPos.X.Scale,
                startPos.X.Offset + delta.X,
                startPos.Y.Scale,
                startPos.Y.Offset + delta.Y
            )
        end
    end)
    frame.InputEnded:Connect(function(input)
        if input == dragInput then
            dragging = false
            if not moved then
                frame:FindFirstChild("ClickEvent"):Fire()
            end
        end
    end)
    local clickEvent = Instance.new("BindableEvent")
    clickEvent.Name = "ClickEvent"
    clickEvent.Parent = frame
    return frame, label, clickEvent
end

local MainFrame, MainLabel, MainClick = createDraggableButton("MainButton", UDim2.new(0,120,0,45), UDim2.new(0.05,0,0.5,0), "AIM: OFF")
local SettingsFrame, SettingsLabel, SettingsClick = createDraggableButton("SettingsButton", UDim2.new(0,120,0,45), UDim2.new(0.05,0,0.6,0), "SETTINGS")

local SettingsPanel = Instance.new("Frame", Gui)
SettingsPanel.Size = UDim2.new(0,300,0,660)
SettingsPanel.Position = UDim2.new(0.65,0,0.1,0)
SettingsPanel.BackgroundColor3 = Color3.fromRGB(20,20,20)
SettingsPanel.Visible = false
SettingsPanel.BorderSizePixel = 0
SettingsPanel.Active = true
local corner2 = Instance.new("UICorner", SettingsPanel)
corner2.CornerRadius = UDim.new(0,14)

do
    local dragging = false
    local dragInput
    local dragStart
    local startPos
    SettingsPanel.InputBegan:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then
            dragging = true
            dragInput = input
            dragStart = input.Position
            startPos = SettingsPanel.Position
        end
    end)
    SettingsPanel.InputChanged:Connect(function(input)
        if input == dragInput and dragging then
            local delta = input.Position - dragStart
            SettingsPanel.Position = UDim2.new(
                startPos.X.Scale,
                startPos.X.Offset + delta.X,
                startPos.Y.Scale,
                startPos.Y.Offset + delta.Y
            )
        end
    end)
    SettingsPanel.InputEnded:Connect(function(input)
        if input == dragInput then
            dragging = false
        end
    end)
end

local function createSlider(text, yPos, min, max, default, callback, formatValue)
    local label = Instance.new("TextLabel", SettingsPanel)
    label.Size = UDim2.new(1, -20, 0, 30)
    label.Position = UDim2.new(0,10,0,yPos)
    label.BackgroundTransparency = 1
    label.Text = text .. ": " .. (formatValue and formatValue(default) or default)
    label.TextColor3 = Color3.new(1,1,1)
    label.TextScaled = true
    label.Font = Enum.Font.Gotham
    local bar = Instance.new("Frame", SettingsPanel)
    bar.Size = UDim2.new(1, -40, 0, 12)
    bar.Position = UDim2.new(0,20,0,yPos+35)
    bar.BackgroundColor3 = Color3.fromRGB(60,60,60)
    bar.BorderSizePixel = 0
    bar.Active = true
    local fill = Instance.new("Frame", bar)
    fill.Size = UDim2.new((default-min)/(max-min), 0, 1, 0)
    fill.BackgroundColor3 = Color3.fromRGB(0,170,255)
    fill.BorderSizePixel = 0
    local dragging = false
    bar.InputBegan:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then
            dragging = true
        end
    end)
    bar.InputChanged:Connect(function(input)
        if dragging then
            local x = math.clamp((input.Position.X - bar.AbsolutePosition.X) / bar.AbsoluteSize.X, 0, 1)
            fill.Size = UDim2.new(x, 0, 1, 0)
            local value = min + (max - min) * x
            label.Text = text .. ": " .. (formatValue and formatValue(value) or math.floor(value))
            callback(value)
        end
    end)
    bar.InputEnded:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then
            dragging = false
        end
    end)
end

local function createToggle(text, yPos, default, callback)
    local label = Instance.new("TextLabel", SettingsPanel)
    label.Size = UDim2.new(0.6, -10, 0, 35)
    label.Position = UDim2.new(0,10,0,yPos)
    label.BackgroundTransparency = 1
    label.Text = text
    label.TextColor3 = Color3.new(1,1,1)
    label.TextScaled = true
    label.Font = Enum.Font.Gotham
    label.TextXAlignment = Enum.TextXAlignment.Left
    local toggleBtn = Instance.new("TextButton", SettingsPanel)
    toggleBtn.Size = UDim2.new(0.25, 0, 0, 35)
    toggleBtn.Position = UDim2.new(0.72, 0, 0, yPos)
    toggleBtn.BackgroundColor3 = default and Color3.fromRGB(0,170,255) or Color3.fromRGB(60,60,60)
    toggleBtn.Text = default and "ON" or "OFF"
    toggleBtn.TextColor3 = Color3.new(1,1,1)
    toggleBtn.TextScaled = true
    toggleBtn.Font = Enum.Font.Gotham
    local corner = Instance.new("UICorner", toggleBtn)
    corner.CornerRadius = UDim.new(0,8)
    local state = default
    toggleBtn.MouseButton1Click:Connect(function()
        state = not state
        toggleBtn.BackgroundColor3 = state and Color3.fromRGB(0,170,255) or Color3.fromRGB(60,60,60)
        toggleBtn.Text = state and "ON" or "OFF"
        callback(state)
    end)
    return toggleBtn
end

local function createModeButton(text, yPos, options, default, callback)
    local label = Instance.new("TextLabel", SettingsPanel)
    label.Size = UDim2.new(0.5, -10, 0, 35)
    label.Position = UDim2.new(0,10,0,yPos)
    label.BackgroundTransparency = 1
    label.Text = text
    label.TextColor3 = Color3.new(1,1,1)
    label.TextScaled = true
    label.Font = Enum.Font.Gotham
    label.TextXAlignment = Enum.TextXAlignment.Left
    local btn = Instance.new("TextButton", SettingsPanel)
    btn.Size = UDim2.new(0.4, 0, 0, 35)
    btn.Position = UDim2.new(0.55, 0, 0, yPos)
    btn.BackgroundColor3 = Color3.fromRGB(60,60,60)
    btn.Text = default
    btn.TextColor3 = Color3.new(1,1,1)
    btn.TextScaled = true
    btn.Font = Enum.Font.Gotham
    local corner = Instance.new("UICorner", btn)
    corner.CornerRadius = UDim.new(0,8)
    local currentIndex = 1
    for i, opt in ipairs(options) do
        if opt == default then
            currentIndex = i
            break
        end
    end
    btn.MouseButton1Click:Connect(function()
        currentIndex = currentIndex % #options + 1
        local newValue = options[currentIndex]
        btn.Text = newValue
        callback(newValue)
    end)
    return btn
end

local function createRadiusTextBox(text, yPos, minValue, maxValue, defaultValue, callback)
    local label = Instance.new("TextLabel", SettingsPanel)
    label.Size = UDim2.new(0.5, -15, 0, 35)
    label.Position = UDim2.new(0,10,0,yPos)
    label.BackgroundTransparency = 1
    label.Text = text .. ":"
    label.TextColor3 = Color3.new(1,1,1)
    label.TextScaled = true
    label.Font = Enum.Font.Gotham
    label.TextXAlignment = Enum.TextXAlignment.Left
    local textBox = Instance.new("TextBox", SettingsPanel)
    textBox.Size = UDim2.new(0.4, 0, 0, 35)
    textBox.Position = UDim2.new(0.55, 0, 0, yPos)
    textBox.BackgroundColor3 = Color3.fromRGB(45,45,45)
    textBox.TextColor3 = Color3.new(1,1,1)
    textBox.Text = tostring(defaultValue)
    textBox.TextScaled = true
    textBox.Font = Enum.Font.Gotham
    textBox.ClearTextOnFocus = false
    textBox.PlaceholderText = tostring(minValue) .. "-" .. tostring(maxValue)
    local corner = Instance.new("UICorner", textBox)
    corner.CornerRadius = UDim.new(0, 8)
    textBox.FocusLost:Connect(function(enterPressed)
        local num = tonumber(textBox.Text)
        if num then
            num = math.clamp(num, minValue, maxValue)
            Settings.AimRadius = num
            textBox.Text = tostring(num)
            callback(num)
        else
            textBox.Text = tostring(Settings.AimRadius)
        end
    end)
    return textBox
end

-- TẠO CÁC THÀNH PHẦN TRONG PANEL SETTINGS
local yOffset = 10

createModeButton("Mode", yOffset, {"Aimlock", "Aimbot"}, "Aimlock", function(v) Settings.Mode = v end)
yOffset = yOffset + 45

createModeButton("Target Mode", yOffset, {"NPC", "Player", "All"}, "NPC", function(v) Settings.TargetMode = v end)
yOffset = yOffset + 45

-- 3 nút Aim Part
local aimPartLabel = Instance.new("TextLabel", SettingsPanel)
aimPartLabel.Size = UDim2.new(1, -20, 0, 30)
aimPartLabel.Position = UDim2.new(0,10,0,yOffset)
aimPartLabel.BackgroundTransparency = 1
aimPartLabel.Text = "AIM PART: AUTO"
aimPartLabel.TextColor3 = Color3.new(1,1,1)
aimPartLabel.TextScaled = true
aimPartLabel.Font = Enum.Font.Gotham
yOffset = yOffset + 35

local autoBtn = Instance.new("TextButton", SettingsPanel)
autoBtn.Size = UDim2.new(0.3, -5, 0, 40)
autoBtn.Position = UDim2.new(0.02, 0, 0, yOffset)
autoBtn.BackgroundColor3 = Color3.fromRGB(0,170,255)
autoBtn.Text = "AUTO"
autoBtn.TextColor3 = Color3.new(1,1,1)
autoBtn.TextScaled = true
autoBtn.Font = Enum.Font.Gotham

local torsoBtn = Instance.new("TextButton", SettingsPanel)
torsoBtn.Size = UDim2.new(0.3, -5, 0, 40)
torsoBtn.Position = UDim2.new(0.35, 0, 0, yOffset)
torsoBtn.BackgroundColor3 = Color3.fromRGB(60,60,60)
torsoBtn.Text = "TORSO"
torsoBtn.TextColor3 = Color3.new(1,1,1)
torsoBtn.TextScaled = true
torsoBtn.Font = Enum.Font.Gotham

local headBtn = Instance.new("TextButton", SettingsPanel)
headBtn.Size = UDim2.new(0.3, -5, 0, 40)
headBtn.Position = UDim2.new(0.68, 0, 0, yOffset)
headBtn.BackgroundColor3 = Color3.fromRGB(60,60,60)
headBtn.Text = "HEAD"
headBtn.TextColor3 = Color3.new(1,1,1)
headBtn.TextScaled = true
headBtn.Font = Enum.Font.Gotham

local function updateAimPartButtons()
    if Settings.AimPartMode == "Auto" then
        autoBtn.BackgroundColor3 = Color3.fromRGB(0,170,255)
        torsoBtn.BackgroundColor3 = Color3.fromRGB(60,60,60)
        headBtn.BackgroundColor3 = Color3.fromRGB(60,60,60)
        aimPartLabel.Text = "AIM PART: AUTO"
    elseif Settings.AimPartMode == "Torso" then
        autoBtn.BackgroundColor3 = Color3.fromRGB(60,60,60)
        torsoBtn.BackgroundColor3 = Color3.fromRGB(0,170,255)
        headBtn.BackgroundColor3 = Color3.fromRGB(60,60,60)
        aimPartLabel.Text = "AIM PART: TORSO"
    elseif Settings.AimPartMode == "Head" then
        autoBtn.BackgroundColor3 = Color3.fromRGB(60,60,60)
        torsoBtn.BackgroundColor3 = Color3.fromRGB(60,60,60)
        headBtn.BackgroundColor3 = Color3.fromRGB(0,170,255)
        aimPartLabel.Text = "AIM PART: HEAD"
    end
end

autoBtn.MouseButton1Click:Connect(function()
    Settings.AimPartMode = "Auto"
    updateAimPartButtons()
end)

torsoBtn.MouseButton1Click:Connect(function()
    Settings.AimPartMode = "Torso"
    updateAimPartButtons()
end)

headBtn.MouseButton1Click:Connect(function()
    Settings.AimPartMode = "Head"
    updateAimPartButtons()
end)

updateAimPartButtons()
yOffset = yOffset + 50

createToggle("Gravity", yOffset, false, function(v) Settings.GravityEnabled = v end)
yOffset = yOffset + 45

createToggle("Anti Lag", yOffset, true, function(v) Settings.AntiLag = v end)
yOffset = yOffset + 45

createToggle("Strong Anti-Lag", yOffset, true, function(v) 
    Settings.StrongAntiLag = v
    if v then
        Settings.AntiLag = true
    end
end)
yOffset = yOffset + 50

createSlider("Bullet Speed", yOffset, 50, 2000, Settings.BulletSpeed, function(v) Settings.BulletSpeed = v end)
yOffset = yOffset + 55

createSlider("Gravity Strength", yOffset, 0, 500, Settings.GravityStrength, function(v) Settings.GravityStrength = v end, function(v) return math.floor(v) .. " (g)" end)
yOffset = yOffset + 55

createRadiusTextBox("Aim Radius", yOffset, 10, 500, Settings.AimRadius, function(v) Settings.AimRadius = v end)
yOffset = yOffset + 50

createSlider("Prediction Strength", yOffset, 0, 200, Settings.PredictionStrength * 100, function(v) Settings.PredictionStrength = v / 100 end)
yOffset = yOffset + 55

createSlider("Aimbot Smoothing", yOffset, 0, 100, Settings.AimbotSmoothing * 100, function(v) Settings.AimbotSmoothing = v / 100 end, function(v) 
    local speedText = v == 0 and "SNAP" or (v < 30 and "RẤT NHANH" or (v < 60 and "NHANH" or (v < 85 and "TRUNG BÌNH" or "CHẬM")))
    return math.floor(v) .. "% (" .. speedText .. ")"
end)
yOffset = yOffset + 55

local wallCheckLabel = Instance.new("TextLabel", SettingsPanel)
wallCheckLabel.Size = UDim2.new(1, -20, 0, 30)
wallCheckLabel.Position = UDim2.new(0,10,0,yOffset)
wallCheckLabel.BackgroundTransparency = 1
wallCheckLabel.Text = "WALL CHECK: HIGH"
wallCheckLabel.TextColor3 = Color3.new(1,1,1)
wallCheckLabel.TextScaled = true
wallCheckLabel.Font = Enum.Font.Gotham
yOffset = yOffset + 35

local wallCheckButton = Instance.new("TextButton", SettingsPanel)
wallCheckButton.Size = UDim2.new(0.8, 0, 0, 40)
wallCheckButton.Position = UDim2.new(0.1, 0, 0, yOffset)
wallCheckButton.BackgroundColor3 = Color3.fromRGB(60,60,60)
wallCheckButton.Text = "Toggle WallCheck Mode"
wallCheckButton.TextColor3 = Color3.new(1,1,1)
wallCheckButton.TextScaled = true
wallCheckButton.Font = Enum.Font.Gotham

wallCheckButton.MouseButton1Click:Connect(function()
    if Settings.WallCheckStrength == "Normal" then
        Settings.WallCheckStrength = "High"
        wallCheckLabel.Text = "WALL CHECK: HIGH"
    else
        Settings.WallCheckStrength = "Normal"
        wallCheckLabel.Text = "WALL CHECK: NORMAL"
    end
end)

local RadiusCircle = Drawing.new("Circle")
RadiusCircle.Visible = Settings.ShowRadius
RadiusCircle.Filled = false
RadiusCircle.Thickness = 2
RadiusCircle.Transparency = 1
RadiusCircle.Color = Color3.fromRGB(0,170,255)
RadiusCircle.NumSides = 100

MainClick.Event:Connect(function()
    Settings.Enabled = not Settings.Enabled
    MainLabel.Text = Settings.Enabled and "AIM: ON" or "AIM: OFF"
end)

SettingsClick.Event:Connect(function()
    SettingsPanel.Visible = not SettingsPanel.Visible
end)
local function isNPC(model)
    return model:IsA("Model") and model:FindFirstChildOfClass("Humanoid") and not Players:GetPlayerFromCharacter(model)
end

local function isPlayer(model)
    return Players:GetPlayerFromCharacter(model) ~= nil
end

local function isValidTarget(character)
    if not character then return false end
    local humanoid = character:FindFirstChildOfClass("Humanoid")
    if not humanoid or humanoid.Health <= 0 then return false end
    if not character:FindFirstChild("HumanoidRootPart") and not character:FindFirstChild("Torso") and not character:FindFirstChild("Head") then
        return false
    end
    return true
end

local function isInViewport(part)
    local screenPos, onScreen = Camera:WorldToViewportPoint(part.Position)
    return onScreen
end

local function isInRadius(part)
    local centerPos = Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y / 2)
    local screenPos, onScreen = Camera:WorldToViewportPoint(part.Position)
    if onScreen then
        local dist = (Vector2.new(screenPos.X, screenPos.Y) - centerPos).Magnitude
        return dist <= Settings.AimRadius
    end
    return false
end

-- LẤY TARGET CHỈ TRONG GÓC NHÌN (STRONG ANTI-LAG)
local function getTargetsInViewport()
    local targets = {}
    for _, model in ipairs(workspace:GetDescendants()) do
        if model:IsA("Model") and isValidTarget(model) then
            local inView = false
            local aimParts = {}
            if model:FindFirstChild("Head") then table.insert(aimParts, model.Head) end
            if model:FindFirstChild("HumanoidRootPart") then table.insert(aimParts, model.HumanoidRootPart) end
            if model:FindFirstChild("Torso") then table.insert(aimParts, model.Torso) end
            if model:FindFirstChild("UpperTorso") then table.insert(aimParts, model.UpperTorso) end
            if model:FindFirstChild("LowerTorso") then table.insert(aimParts, model.LowerTorso) end
            
            for _, part in ipairs(aimParts) do
                if isInViewport(part) then
                    inView = true
                    break
                end
            end
            
            if inView then
                if Settings.TargetMode == "NPC" and isNPC(model) then
                    table.insert(targets, model)
                elseif Settings.TargetMode == "Player" and isPlayer(model) and model ~= LocalPlayer.Character then
                    table.insert(targets, model)
                elseif Settings.TargetMode == "All" and (isNPC(model) or (isPlayer(model) and model ~= LocalPlayer.Character)) then
                    table.insert(targets, model)
                end
            end
        end
    end
    return targets
end

-- LẤY TARGET TRONG RADIUS (ANTI-LAG THƯỜNG)
local function getValidTargetsInRadius()
    local targets = {}
    for _, model in ipairs(workspace:GetDescendants()) do
        if model:IsA("Model") and isValidTarget(model) then
            local hasPartInRadius = false
            local aimParts = {}
            if model:FindFirstChild("Head") then table.insert(aimParts, model.Head) end
            if model:FindFirstChild("HumanoidRootPart") then table.insert(aimParts, model.HumanoidRootPart) end
            if model:FindFirstChild("Torso") then table.insert(aimParts, model.Torso) end
            if model:FindFirstChild("UpperTorso") then table.insert(aimParts, model.UpperTorso) end
            if model:FindFirstChild("LowerTorso") then table.insert(aimParts, model.LowerTorso) end
            
            for _, part in ipairs(aimParts) do
                if isInRadius(part) then
                    hasPartInRadius = true
                    break
                end
            end
            
            if hasPartInRadius then
                if Settings.TargetMode == "NPC" and isNPC(model) then
                    table.insert(targets, model)
                elseif Settings.TargetMode == "Player" and isPlayer(model) and model ~= LocalPlayer.Character then
                    table.insert(targets, model)
                elseif Settings.TargetMode == "All" and (isNPC(model) or (isPlayer(model) and model ~= LocalPlayer.Character)) then
                    table.insert(targets, model)
                end
            end
        end
    end
    return targets
end

local function getAimParts(character)
    local parts = {}
    
    if Settings.AimPartMode == "Auto" then
        if character:FindFirstChild("Head") then table.insert(parts, character.Head) end
        if character:FindFirstChild("HumanoidRootPart") then table.insert(parts, character.HumanoidRootPart) end
        if character:FindFirstChild("Torso") then table.insert(parts, character.Torso) end
        if character:FindFirstChild("UpperTorso") then table.insert(parts, character.UpperTorso) end
        if character:FindFirstChild("LowerTorso") then table.insert(parts, character.LowerTorso) end
    elseif Settings.AimPartMode == "Torso" then
        if character:FindFirstChild("HumanoidRootPart") then table.insert(parts, character.HumanoidRootPart) end
        if character:FindFirstChild("Torso") then table.insert(parts, character.Torso) end
        if character:FindFirstChild("UpperTorso") then table.insert(parts, character.UpperTorso) end
        if character:FindFirstChild("LowerTorso") then table.insert(parts, character.LowerTorso) end
    elseif Settings.AimPartMode == "Head" then
        if character:FindFirstChild("Head") then table.insert(parts, character.Head) end
    end
    
    return parts
end

local function enhancedWallCheck(origin, targetPart)
    if not Settings.WallCheck then return true end
    local targetPos = targetPart.Position
    local direction = (targetPos - origin).Unit
    local distance = (targetPos - origin).Magnitude
    local params = RaycastParams.new()
    params.FilterDescendantsInstances = {LocalPlayer.Character}
    params.FilterType = Enum.RaycastFilterType.Blacklist
    if Settings.WallCheckStrength == "High" then
        local checkPoints = {
            targetPos,
            targetPos + Vector3.new(0.5, 0.5, 0),
            targetPos + Vector3.new(-0.5, 0.5, 0),
            targetPos + Vector3.new(0.5, -0.5, 0),
            targetPos + Vector3.new(-0.5, -0.5, 0),
        }
        local hitCount = 0
        for _, point in ipairs(checkPoints) do
            local result = workspace:Raycast(origin, (point - origin), params)
            if result and result.Instance and not result.Instance:IsDescendantOf(targetPart.Parent) then
                hitCount = hitCount + 1
            end
        end
        return hitCount <= 2
    else
        local offsetDirection = direction + Vector3.new(0, 0.3, 0)
        local result = workspace:Raycast(origin, offsetDirection * distance, params)
        if result and result.Instance and not result.Instance:IsDescendantOf(targetPart.Parent) then
            return false
        end
        return true
    end
end

local function predictPosition(part)
    local velocity = part.AssemblyLinearVelocity
    local distance = (Camera.CFrame.Position - part.Position).Magnitude
    local travelTime = distance / Settings.BulletSpeed
    local predictedPos = part.Position + (velocity * travelTime * Settings.PredictionStrength)
    if Settings.GravityEnabled then
        local drop = 0.5 * Settings.GravityStrength * (travelTime * travelTime)
        predictedPos = Vector3.new(predictedPos.X, predictedPos.Y + drop, predictedPos.Z)
    end
    return predictedPos
end

local currentTarget = nil
local targetLockFrames = 0
local scanFrames = 0 -- Giảm tần suất quét khi strong anti-lag bật

local function getClosestToCenterTarget()
    local centerPos = Vector2.new(Camera.ViewportSize.X / 2, Camera.ViewportSize.Y / 2)
    local closestPart = nil
    local closestDist = Settings.AimRadius
    
    -- Kiểm tra target hiện tại
    if currentTarget and isValidTarget(currentTarget.Parent) then
        local screenPos, onScreen = Camera:WorldToViewportPoint(currentTarget.Position)
        if onScreen then
            local dist = (Vector2.new(screenPos.X, screenPos.Y) - centerPos).Magnitude
            if dist < Settings.AimRadius and enhancedWallCheck(Camera.CFrame.Position, currentTarget) then
                closestPart = currentTarget
                closestDist = dist
                targetLockFrames = targetLockFrames + 1
            else
                targetLockFrames = 0
            end
        else
            targetLockFrames = 0
        end
    end
    
    -- Tìm target mới nếu cần
    if not closestPart or targetLockFrames > 30 then
        targetLockFrames = 0
        
        local targets
        if Settings.StrongAntiLag then
            -- STRONG ANTI-LAG: Chỉ lấy targets trong góc nhìn, giảm tần suất quét
            scanFrames = scanFrames + 1
            if scanFrames % 3 == 0 then -- Quét mỗi 3 frame
                targets = getTargetsInViewport()
            else
                targets = {}
            end
        elseif Settings.AntiLag then
            targets = getValidTargetsInRadius()
        else
            targets = getValidTargetsAll()
        end
        
        for _, character in ipairs(targets) do
            for _, part in ipairs(getAimParts(character)) do
                local screenPos, onScreen = Camera:WorldToViewportPoint(part.Position)
                if onScreen then
                    local dist = (Vector2.new(screenPos.X, screenPos.Y) - centerPos).Magnitude
                    if dist < closestDist and enhancedWallCheck(Camera.CFrame.Position, part) then
                        closestDist = dist
                        closestPart = part
                    end
                end
            end
        end
    end
    
    currentTarget = closestPart
    return closestPart
end

local function aimAt(position)
    if Settings.Mode == "Aimlock" then
        Camera.CFrame = CFrame.new(Camera.CFrame.Position, position)
    else
        local smoothFactor = 1 - Settings.AimbotSmoothing
        if smoothFactor <= 0.01 then
            Camera.CFrame = CFrame.new(Camera.CFrame.Position, position)
        else
            Camera.CFrame = Camera.CFrame:Lerp(CFrame.new(Camera.CFrame.Position, position), smoothFactor)
        end
    end
end

RunService.RenderStepped:Connect(function()
    RadiusCircle.Visible = Settings.ShowRadius
    RadiusCircle.Radius = Settings.AimRadius
    RadiusCircle.Position = UserInputService:GetMouseLocation()
    
    if not Settings.Enabled then
        currentTarget = nil
        return
    end
    
    local targetPart = getClosestToCenterTarget()
    if targetPart then
        local character = targetPart.Parent
        if isValidTarget(character) then
            if enhancedWallCheck(Camera.CFrame.Position, targetPart) then
                local aimPos = predictPosition(targetPart)
                aimAt(aimPos)
            end
        else
            currentTarget = nil
        end
    else
        currentTarget = nil
    end
end)

Features & Information

...

Community Comments (1)

erylhabibierylhabibiMay 2, 2026

Wow this scrip like gold if you make aimbot npc again pls make so strong grip🙏❤️‍🔥

More Scripts for Universal Scripts