UNIVERSAL ESP AIMLOCK V2
Key RequiredUniversal

UNIVERSAL ESP AIMLOCK V2

Universal Scripthanzo*hanzo* 761 views 50 executesUpdated Jan 8, 2026
5.0/ 5(1 votes)
10100% Positive
Lua Script•993 lines (37103 chars)
-- 🎯 AIMBOT ULTRA-PRECIso + ESP SEPARADO (VERSÃO DEFINITIVA)
-- Sistema otimizado para headshots + ESP profissional independente
-- ✅ ZERO "attempt to index nil" - Validações ultra-rigorosas implementadas

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")
local UIS = game:GetService("UserInputService")
local LocalPlayer = Players.LocalPlayer

-- ========================================================================
-- 🟦 [ SISTEMA 1: DADOS ] - ESTADO PURO DO JOGO
-- ========================================================================

local GameDataSystem = {}

function GameDataSystem.getPlayers()
    if not Players or not Players.GetPlayers then return {} end
    local success, players = pcall(function() return Players:GetPlayers() end)
    return success and players or {}
end

function GameDataSystem.getLocalPlayer()
    return LocalPlayer or nil
end

function GameDataSystem.getCamera()
    if not workspace or not workspace.CurrentCamera then return nil end
    return workspace.CurrentCamera
end

function GameDataSystem.playerExists(player)
    return player and player:IsDescendantOf(Players)
end

function GameDataSystem.getCharacter(player)
    if not GameDataSystem.playerExists(player) then return nil end
    return player.Character
end

function GameDataSystem.characterExists(character)
    return character and character:IsDescendantOf(workspace)
end

function GameDataSystem.getHumanoid(character)
    if not GameDataSystem.characterExists(character) then return nil end
    return character:FindFirstChild("Humanoid")
end

function GameDataSystem.getHead(character)
    if not GameDataSystem.characterExists(character) then return nil end
    return character:FindFirstChild("Head")
end

function GameDataSystem.getRootPart(character)
    if not GameDataSystem.characterExists(character) then return nil end
    return character:FindFirstChild("HumanoidRootPart")
end

function GameDataSystem.getTeam(player)
    if not GameDataSystem.playerExists(player) then return nil end
    return player.Team
end

function GameDataSystem.getPosition(part)
    if not part or not part:IsA("BasePart") or not part:IsDescendantOf(workspace) then
        return Vector3.zero
    end
    local success, pos = pcall(function() return part.Position end)
    return success and pos and typeof(pos) == "Vector3" and pos or Vector3.zero
end

function GameDataSystem.getVelocity(part)
    if not part or not part:IsA("BasePart") or not part:IsDescendantOf(workspace) then
        return Vector3.zero
    end
    local success, vel = pcall(function() return part.AssemblyLinearVelocity end)
    return success and vel and typeof(vel) == "Vector3" and vel or Vector3.zero
end

function GameDataSystem.isAlive(humanoid)
    if not humanoid or not humanoid:IsDescendantOf(workspace) then return false end
    local success, health = pcall(function() return humanoid.Health end)
    return success and type(health) == "number" and health > 0
end

function GameDataSystem.getViewportSize(camera)
    if not camera then return Vector2.zero end
    local success, size = pcall(function() return camera.ViewportSize end)
    return success and size or Vector2.zero
end

function GameDataSystem.getMouseLocation()
    if not UIS or not UIS.GetMouseLocation then return Vector2.zero end
    local success, pos = pcall(function() return UIS:GetMouseLocation() end)
    return success and pos or Vector2.zero
end

-- ========================================================================
-- [ CONFIGURAÇÕES ULTRA-PRECISAS ] - OTIMIZADAS PARA CABEÇA
-- ========================================================================
local Config = {
    AIM_ENABLED = true,
    FOV_SIZE = 70,         -- FOV MAIS RESTRITO PARA CABEÇA (antes: 80)
    SMOOTHNESS = 0.04,     -- SUAVIZAÇÃO ULTRA-RÁPIDA PARA GRUDAÇÃO FORTE (antes: 0.06)
    HEAD_PRIORITY = true,  -- SEMPRE PRIORIZAR CABEÇA
    PREDICTION_ENABLED = true, -- PREDIÇÃO DE MOVIMENTO
    PREDICTION_TIME = 0.0, -- PREDIÇÃO MAIS CURTA PARA CABEÇA (0ms)
    UI_VISIBLE = false,
    WINDOW_ACTIVE = true,
    HEAD_BONUS_STRENGTH = 2.0  -- BONUS EXTRA PARA CABEÇA (100% mais forte)
}

-- ========================================================================
-- [ CONFIGURAÇÕES ESP MELHORADO ]
-- ========================================================================
getgenv().ESP_Settings = {
    Enabled = true,              -- Estado inicial
    ToggleKey = Enum.KeyCode.RightShift,

    DistanciaLimite = 300,       -- Distância máxima

    TeamCheck = true,            -- Verificar aliados
    TeamColor = Color3.fromRGB(0, 255, 0),      -- Verde
    EnemyColor = Color3.fromRGB(255, 0, 0),     -- Vermelho

    TextSize = 13,
    BoxThickness = 1,

    -- Configuração do Botão
    ButtonConfig = {
        Size = Vector2.new(120, 30),
        TextColor = Color3.new(1, 1, 1),
        EnabledColor = Color3.fromRGB(0, 150, 0),
        DisabledColor = Color3.fromRGB(150, 0, 0),
        TextFont = 2,
        TextSize = 15
    }
}

-- ========================================================================
-- [ CONTROLE DE FOCO ULTRA-SEGURO ]
-- ========================================================================
local WindowFocus = {
    janelaEmFoco = true,
    aimAtivo = false,
    alvoAtual = nil
}

function WindowFocus.inicializar()
    UIS.WindowFocused:Connect(function()
        WindowFocus.janelaEmFoco = true
        print("🖥️ ROBLOX EM FOCO - AIMLIBERADO")
    end)

    UIS.WindowFocusReleased:Connect(function()
        WindowFocus.janelaEmFoco = false
        WindowFocus.aimAtivo = false
        WindowFocus.alvoAtual = nil
        print("🚨 ROBLOX PERDEU FOCO - AIMDESABILITADO")
    end)

    WindowFocus.janelaEmFoco = true
end

-- ========================================================================
-- [ DETECÇÃO DE INIMIGOS ULTRA-RÁPIDA ]
-- ========================================================================
local EnemyDetector = {}

function EnemyDetector.ehInimigo(player)
    -- ✅ CORREÇÃO: Sistema de teams robusto (evita "No hook for GetTeam")
    if not GameDataSystem.playerExists(player) or player == LocalPlayer then return false end

    local playerTeam = GameDataSystem.getTeam(player)
    local localTeam = GameDataSystem.getTeam(GameDataSystem.getLocalPlayer())

    if playerTeam and localTeam then
        return playerTeam ~= localTeam
    end

    -- Método 2: Verificar atributos customizados
    local success1, playerAttrs = pcall(function() return player:GetAttributes() end)
    local success2, localAttrs = pcall(function() return LocalPlayer:GetAttributes() end)

    if success1 and success2 and playerAttrs and localAttrs then
        for attrName, attrValue in pairs(playerAttrs) do
            if type(attrName) == "string" and (attrName:lower():find("team") or attrName:lower():find("faction")) then
                local localAttrValue = localAttrs[attrName]
                if localAttrValue and attrValue ~= localAttrValue then
                    return true -- ✅ Times diferentes
                end
            end
        end
    end

    return true -- FFA MODE
end

function EnemyDetector.ehValido(player)
    -- ✅ CORREÇÃO: Validação ultra-rigorosa
    if not GameDataSystem.playerExists(player) then return false end

    local character = GameDataSystem.getCharacter(player)
    if not character or not GameDataSystem.characterExists(character) then return false end

    local humanoid = GameDataSystem.getHumanoid(character)
    return GameDataSystem.isAlive(humanoid)
end

-- ========================================================================
-- [ SELEÇÃO DE CABEÇA ULTRA-PRIORITÁRIA ] - MELHORADO PARA HEADSHOTS
-- ========================================================================
local BodyPartSelector = {}

-- 🔥 FUNÇÃO ESPECIAL: SEMPRE PEGA A CABEÇA PRIMEIRO
function BodyPartSelector.getHead(character)
    -- ✅ CORREÇÃO: Validação antes de qualquer acesso
    if not GameDataSystem.characterExists(character) then return nil end

    -- SEMPRE TENTA CABEÇA PRIMEIRO - MÚLTIPLAS VERIFICAÇÕES
    local head = character:FindFirstChild("Head")
    if head and head:IsA("BasePart") and head:IsDescendantOf(character) then
        return head
    end

    -- FALLBACK PARA DIFERENTES NOMES DE CABEÇA
    local headNames = {"Head", "head", "HEAD"}
    for _, name in ipairs(headNames) do
        if type(name) == "string" then
            local found = character:FindFirstChild(name)
            if found and found:IsA("BasePart") and found:IsDescendantOf(character) then
                return found
            end
        end
    end

    return nil
end

-- 🔥 PREDIÇÃO DE MOVIMENTO PARA PRECISÃO MÁXIMA
function BodyPartSelector.predictPosition(bodyPart, predictionTime)
    -- ✅ CORREÇÃO: Validação ultra-rigorosa antes de cálculos
    if not bodyPart or not bodyPart:IsA("BasePart") or not bodyPart:IsDescendantOf(workspace) then
        return GameDataSystem.getPosition(bodyPart)
    end

    if not Config.PREDICTION_ENABLED or type(predictionTime) ~= "number" or predictionTime <= 0 then
        return GameDataSystem.getPosition(bodyPart)
    end

    -- CALCULAR VELOCIDADE PARA PREDIÇÃO
    local position = GameDataSystem.getPosition(bodyPart)
    local velocity = GameDataSystem.getVelocity(bodyPart)

    -- ✅ CORREÇÃO: Verificação se valores são válidos antes da conta
    if position ~= Vector3.zero and velocity ~= Vector3.zero then
        return position + (velocity * predictionTime)
    end

    return position
end

-- 🔥 LÓGICA PRINCIPAL: CABEÇA SEMPRE PRIORITÁRIA
function BodyPartSelector.encontrarMelhorParte(character)
    -- ✅ CORREÇÃO: Validação antes de qualquer acesso
    if not GameDataSystem.characterExists(character) then return nil end

    -- 🔥 CABEÇA SEMPRE É PRIORIDADE MÁXIMA
    if Config.HEAD_PRIORITY then
        local head = BodyPartSelector.getHead(character)
        if head then
            return head -- 🔥 SEMPRE RETORNA CABEÇA PARA HEADSHOTS
        end
    end

    -- FALLBACK APENAS SE CABEÇA NÃO EXISTIR
    local fallbacks = {
        character:FindFirstChild("UpperTorso"),
        character:FindFirstChild("HumanoidRootPart"),
        character:FindFirstChild("Torso")
    }

    for _, part in ipairs(fallbacks) do
        if part and part:IsA("BasePart") and part:IsDescendantOf(character) then
            return part
        end
    end

    return nil
end

-- ========================================================================
-- [ FOV ULTRA-PRECISO ] - RESTRITO PARA CABEÇA
-- ========================================================================
local FOVSystem = {
    circulo = nil
}

function FOVSystem.criarCirculo()
    if FOVSystem.circulo then FOVSystem.circulo:Remove() end

    FOVSystem.circulo = Drawing.new("Circle")
    FOVSystem.circulo.Thickness = 2
    FOVSystem.circulo.NumSides = 32
    FOVSystem.circulo.Radius = Config.FOV_SIZE
    FOVSystem.circulo.Filled = false
    FOVSystem.circulo.Color = Color3.fromRGB(255, 255, 255)
    FOVSystem.circulo.Transparency = 0.7
    FOVSystem.circulo.Visible = false
end

function FOVSystem.calcular(posicaoMundo, camera)
    -- ✅ CORREÇÃO: Validação ultra-rigorosa
    if not posicaoMundo or typeof(posicaoMundo) ~= "Vector3" or not camera then return false end

    local centroTela = GameDataSystem.getViewportSize(camera)
    if centroTela == Vector2.zero then return false end
    centroTela = centroTela / 2

    local success, screenPos, visible = pcall(function()
        return camera:WorldToViewportPoint(posicaoMundo)
    end)

    if not success or not visible or not screenPos then return false end

    local distancia = (Vector2.new(screenPos.X, screenPos.Y) - centroTela).Magnitude
    return distancia <= Config.FOV_SIZE
end

function FOVSystem.atualizar()
    if not FOVSystem.circulo then return end

    local camera = GameDataSystem.getCamera()
    if not camera then return end

    local centro = GameDataSystem.getViewportSize(camera)
    if centro == Vector2.zero then return end
    centro = centro / 2

    FOVSystem.circulo.Position = centro
    FOVSystem.circulo.Radius = Config.FOV_SIZE
    FOVSystem.circulo.Visible = WindowFocus.aimAtivo and WindowFocus.janelaEmFoco
end

-- ========================================================================
-- [ SELETOR DE ALVO ULTRA-RÁPIDO ] - FOCADO EM CABEÇA
-- ========================================================================
local TargetSelector = {}

function TargetSelector.encontrarMelhor(camera)
    -- ✅ CORREÇÃO: Validação ultra-rigorosa antes de qualquer loop
    if not camera then return nil end

    local melhorAlvo = nil
    local menorDistancia = Config.FOV_SIZE
    local centroTela = GameDataSystem.getViewportSize(camera)
    if centroTela == Vector2.zero then return nil end
    centroTela = centroTela / 2

    for _, player in ipairs(GameDataSystem.getPlayers()) do
        -- ✅ VALIDAÇÃO: Player existe e é válido
        if not EnemyDetector.ehInimigo(player) or not EnemyDetector.ehValido(player) then
            continue
        end

        -- 🔥 VERIFICAÇÃO ESPECIAL: CABEÇA DEVE EXISTIR
        local character = GameDataSystem.getCharacter(player)
        if not character then continue end

        local head = BodyPartSelector.getHead(character)
        if not head then continue end

        -- 🔥 PREDIÇÃO PARA CABEÇA
        local targetPosition = BodyPartSelector.predictPosition(head, Config.PREDICTION_TIME)
        if targetPosition == Vector3.zero then continue end

        -- VERIFICAÇÃO FOV COM PREDIÇÃO
        if not FOVSystem.calcular(targetPosition, camera) then
            continue
        end

        -- DISTÂNCIA DA CABEÇA PREDITA
        local success, screenPos, visible = pcall(function()
            return camera:WorldToViewportPoint(targetPosition)
        end)

        if not success or not visible or not screenPos then continue end

        local distancia = (Vector2.new(screenPos.X, screenPos.Y) - centroTela).Magnitude

        if distancia < menorDistancia then
            menorDistancia = distancia
            melhorAlvo = player
        end
    end

    return melhorAlvo
end

-- ========================================================================
-- [ AIMLOCK ULTRA-PRECIso ] - OTIMIZADO PARA CABEÇA
-- ========================================================================
local AimController = {
    suavizacao = Config.SMOOTHNESS
}

function AimController.aplicar(alvoAtual, camera)
    -- 🔥 VERIFICAÇÕES AVANÇADAS PARA GRUDAÇÃO MÁXIMA
    if not WindowFocus.janelaEmFoco or not WindowFocus.aimAtivo then
        return
    end

    -- VERIFICAÇÃO RIGOROSA DO ALVO
    if not alvoAtual or not alvoAtual:IsDescendantOf(Players) then
        WindowFocus.alvoAtual = nil
        return
    end

    if not EnemyDetector.ehValido(alvoAtual) then
        WindowFocus.alvoAtual = nil
        return
    end

    local character = alvoAtual.Character
    if not character or not character:IsDescendantOf(workspace) then
        WindowFocus.alvoAtual = nil
        return
    end

    -- 🔥 SISTEMA AVANÇADO DE DETECÇÃO DE CABEÇA
    local head = BodyPartSelector.getHead(character)
    if not head or not head:IsDescendantOf(character) then
        -- FALLBACK: tentar encontrar cabeça novamente
        head = character:FindFirstChild("Head") or character:FindFirstChild("head")
        if not head then
            WindowFocus.alvoAtual = nil
            return
        end
    end

    -- 🔥 PREDIÇÃO AVANÇADA COM MÚLTIPLAS VERIFICAÇÕES
    local targetPosition = BodyPartSelector.predictPosition(head, Config.PREDICTION_TIME)

    -- VERIFICAÇÃO FOV ULTRA-ESTRITA COM MÚLTIPLOS CHECKS
    if not FOVSystem.calcular(targetPosition, camera) then
        -- TENTATIVA SECUNDÁRIA: verificar posição atual da cabeça
        local currentPos = GameDataSystem.getPosition(head)
        if currentPos == Vector3.zero or not FOVSystem.calcular(currentPos, camera) then
            WindowFocus.alvoAtual = nil
            return
        end
        targetPosition = currentPos
    end

    -- POSIÇÃO DA CABEÇA NA TELA COM VALIDAÇÃO
    local success, screenPos, visible = pcall(function()
        return camera:WorldToViewportPoint(targetPosition)
    end)

    if not success or not visible or not screenPos then
        WindowFocus.alvoAtual = nil
        return
    end

    -- VERIFICAÇÃO DE DISTÂNCIA DA TELA (não pode estar muito longe)
    local screenCenter = GameDataSystem.getViewportSize(camera)
    if screenCenter == Vector2.zero then return end
    screenCenter = screenCenter / 2

    local screenDistance = (Vector2.new(screenPos.X, screenPos.Y) - screenCenter).Magnitude
    if screenDistance > Config.FOV_SIZE * 1.5 then  -- 50% de tolerância
        WindowFocus.alvoAtual = nil
        return
    end

    -- POSIÇÃO ATUAL DO MOUSE COM VALIDAÇÃO
    local mousePos = GameDataSystem.getMouseLocation()
    if mousePos == Vector2.zero then return end

    -- DIFERENÇA ULTRA-PRECISA COM VALIDAÇÃO
    local delta = Vector2.new(screenPos.X, screenPos.Y) - mousePos

    -- 🔥 SISTEMA ULTRA-FORTE DE GRUDAÇÃO NA CABEÇA
    -- THRESHOLD ULTRA-BAIXO PARA CABEÇA: muito mais sensível
    local distanceFactor = screenDistance / Config.FOV_SIZE
    local adaptiveThreshold = math.max(0.03, 1.2 - (distanceFactor * 0.8)) -- Threshold muito menor para cabeça

    if math.abs(delta.X) > adaptiveThreshold or math.abs(delta.Y) > adaptiveThreshold then
        -- 🔥 SUAVIZAÇÃO ULTRA-FORTE PARA CABEÇA
        local adaptiveSmoothness = Config.SMOOTHNESS * (1 + distanceFactor * 0.8) -- Muito mais rápida quando longe

        -- BONUS ULTRA-FORTE PARA CABEÇA: 80% mais forte na cabeça
        local headBonus = Config.HEAD_BONUS_STRENGTH -- 1.8 = 80% mais forte
        adaptiveSmoothness = adaptiveSmoothness * headBonus

        -- LIMITES ULTRA-EXPANDIDOS PARA GRUDAÇÃO MÁXIMA NA CABEÇA
        local maxMove = math.clamp(50 + (distanceFactor * 35), 30, 85) -- Limites muito maiores para cabeça
        local moveX = math.clamp(delta.X * adaptiveSmoothness, -maxMove, maxMove)
        local moveY = math.clamp(delta.Y * adaptiveSmoothness, -maxMove, maxMove)

        -- VALIDAÇÃO FINAL ANTES DO MOVIMENTO
        if moveX == moveX and moveY == moveY and -- Verificar se não é NaN
           math.abs(moveX) > 0.1 and math.abs(moveY) > 0.1 then -- Movimento mínimo

            -- MOVIMENTO ULTRA-SEGURO COM LOG DETALHADO
            local moveSuccess = pcall(function()
                mousemoverel(moveX, moveY)
            end)

            if moveSuccess then
                -- VISUAL FEEDBACK AVANÇADO
                if FOVSystem.circulo then
                    -- COR BASEADA NA DISTÂNCIA: vermelho = longe, verde = perto
                    local colorIntensity = 1 - math.min(distanceFactor, 1)
                    FOVSystem.circulo.Color = Color3.new(1, colorIntensity, 0) -- Amarelo para longe, vermelho para perto
                end
            else
                print("❌ Falha ao mover mouse para", alvoAtual.Name)
            end
        end
    else
        -- VISUAL FEEDBACK QUANDO PRECISO (VERDE)
        if FOVSystem.circulo then
            FOVSystem.circulo.Color = Color3.fromRGB(0, 255, 0)
        end
    end
end

-- ========================================================================
-- [ UI HUB PREMIUM ANIMADO ] - DARK/CLEAN/TECH COM EFEITOS MODERNOS
-- ========================================================================
local UIController = {
    painel = nil,
    gui = nil,
    dragging = false,
    dragStart = nil,
    startPos = nil
}

-- SEM SISTEMA DE ANIMAÇÕES - BOTÕES SIMPLES E DIRETOS

function UIController.criar()
    local playerGui = LocalPlayer:WaitForChild("PlayerGui", 10)
    if not playerGui then return end

    UIController.gui = Instance.new("ScreenGui")
    UIController.gui.Name = "PremiumHub"
    UIController.gui.ResetOnSpawn = false
    UIController.gui.Enabled = true
    UIController.gui.Parent = playerGui

    -- PAINEL PRINCIPAL - SIMPLES E DIRETO
    UIController.painel = Instance.new("Frame")
    UIController.painel.Size = UDim2.new(0, 280, 0, 320)
    UIController.painel.Position = UDim2.new(0.8, -140, 0.1, 0)
    UIController.painel.AnchorPoint = Vector2.new(0.5, 0.5)
    UIController.painel.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
    UIController.painel.BackgroundTransparency = 0 -- SÓLIDO
    UIController.painel.BorderSizePixel = 2
    UIController.painel.BorderColor3 = Color3.fromRGB(60, 60, 60)
    UIController.painel.Parent = UIController.gui
    UIController.painel.Active = true
    UIController.painel.Visible = false

    -- CORNERS SIMPLES
    local corner = Instance.new("UICorner")
    corner.CornerRadius = UDim.new(0, 8)
    corner.Parent = UIController.painel

    -- CABEÇALHO
    local header = Instance.new("Frame")
    header.Size = UDim2.new(1, 0, 0, 45)
    header.BackgroundTransparency = 1
    header.Parent = UIController.painel

    local title = Instance.new("TextLabel")
    title.Size = UDim2.new(1, -20, 1, 0)
    title.Position = UDim2.new(0, 20, 0, 0)
    title.BackgroundTransparency = 1
    title.Text = "Universal Hub"
    title.Font = Enum.Font.GothamBold
    title.TextSize = 18
    title.TextColor3 = Color3.fromRGB(220, 220, 230)
    title.TextXAlignment = Enum.TextXAlignment.Left
    title.Parent = header

    -- CONTEÚDO PRINCIPAL
    local content = Instance.new("Frame")
    content.Size = UDim2.new(1, -40, 1, -65)
    content.Position = UDim2.new(0, 20, 0, 50)
    content.BackgroundTransparency = 1
    content.Parent = UIController.painel

    -- ESPAÇAMENTO ENTRE SEÇÕES
    local yOffset = 0

    -- SEÇÃO AIMBOT
    local aimSection = Instance.new("Frame")
    aimSection.Size = UDim2.new(1, 0, 0, 70)
    aimSection.Position = UDim2.new(0, 0, 0, yOffset)
    aimSection.BackgroundTransparency = 1
    aimSection.Parent = content

    -- TÍTULO AIMBOT
    local aimTitle = Instance.new("TextLabel")
    aimTitle.Size = UDim2.new(1, 0, 0, 20)
    aimTitle.BackgroundTransparency = 1
    aimTitle.Text = "AIMBOT"
    aimTitle.Font = Enum.Font.GothamMedium
    aimTitle.TextSize = 12
    aimTitle.TextColor3 = Color3.fromRGB(180, 180, 190)
    aimTitle.TextXAlignment = Enum.TextXAlignment.Left
    aimTitle.Parent = aimSection

    -- TOGGLE AIMBOT SIMPLES E SÓLIDO
    local aimToggle = Instance.new("TextButton")
    aimToggle.Size = UDim2.new(1, 0, 0, 32)
    aimToggle.Position = UDim2.new(0, 0, 0, 25)
    aimToggle.BackgroundColor3 = WindowFocus.aimAtivo and Color3.fromRGB(0, 150, 0) or Color3.fromRGB(150, 0, 0)
    aimToggle.BackgroundTransparency = 0 -- SÓLIDO, SEM TRANSPARÊNCIA
    aimToggle.Text = WindowFocus.aimAtivo and "ENABLED" or "DISABLED"
    aimToggle.Font = Enum.Font.GothamBold
    aimToggle.TextSize = 13
    aimToggle.TextColor3 = Color3.fromRGB(255, 255, 255)
    aimToggle.BorderSizePixel = 0
    aimToggle.Parent = aimSection

    local aimCorner = Instance.new("UICorner")
    aimCorner.CornerRadius = UDim.new(0, 6)
    aimCorner.Parent = aimToggle

    -- SEM GLOW, SEM EFEITOS EXTRAS

    yOffset = yOffset + 85

    -- SEÇÃO ESP
    local espSection = Instance.new("Frame")
    espSection.Size = UDim2.new(1, 0, 0, 70)
    espSection.Position = UDim2.new(0, 0, 0, yOffset)
    espSection.BackgroundTransparency = 1
    espSection.Parent = content

    -- TÍTULO ESP
    local espTitle = Instance.new("TextLabel")
    espTitle.Size = UDim2.new(1, 0, 0, 20)
    espTitle.BackgroundTransparency = 1
    espTitle.Text = "ESP"
    espTitle.Font = Enum.Font.GothamMedium
    espTitle.TextSize = 12
    espTitle.TextColor3 = Color3.fromRGB(180, 180, 190)
    espTitle.TextXAlignment = Enum.TextXAlignment.Left
    espTitle.Parent = espSection

    -- TOGGLE ESP SIMPLES E SÓLIDO
    local espToggle = Instance.new("TextButton")
    espToggle.Size = UDim2.new(1, 0, 0, 32)
    espToggle.Position = UDim2.new(0, 0, 0, 25)
    espToggle.BackgroundColor3 = getgenv().ESP_Settings.Enabled and Color3.fromRGB(0, 150, 0) or Color3.fromRGB(150, 0, 0)
    espToggle.BackgroundTransparency = 0 -- SÓLIDO, SEM TRANSPARÊNCIA
    espToggle.Text = getgenv().ESP_Settings.Enabled and "ENABLED" or "DISABLED"
    espToggle.Font = Enum.Font.GothamBold
    espToggle.TextSize = 13
    espToggle.TextColor3 = Color3.fromRGB(255, 255, 255)
    espToggle.BorderSizePixel = 0
    espToggle.Parent = espSection

    local espCorner = Instance.new("UICorner")
    espCorner.CornerRadius = UDim.new(0, 6)
    espCorner.Parent = espToggle

    -- SEM GLOW, SEM EFEITOS EXTRAS

    yOffset = yOffset + 85

    -- SEÇÃO FOV
    local fovSection = Instance.new("Frame")
    fovSection.Size = UDim2.new(1, 0, 0, 70)
    fovSection.Position = UDim2.new(0, 0, 0, yOffset)
    fovSection.BackgroundTransparency = 1
    fovSection.Parent = content

    -- TÍTULO FOV
    local fovTitle = Instance.new("TextLabel")
    fovTitle.Size = UDim2.new(1, 0, 0, 20)
    fovTitle.BackgroundTransparency = 1
    fovTitle.Text = "FOV"
    fovTitle.Font = Enum.Font.GothamMedium
    fovTitle.TextSize = 12
    fovTitle.TextColor3 = Color3.fromRGB(180, 180, 190)
    fovTitle.TextXAlignment = Enum.TextXAlignment.Left
    fovTitle.Parent = fovSection

    -- VALOR FOV
    local fovValue = Instance.new("TextLabel")
    fovValue.Size = UDim2.new(0, 40, 0, 20)
    fovValue.Position = UDim2.new(1, -40, 0, 0)
    fovValue.BackgroundTransparency = 1
    fovValue.Text = tostring(Config.FOV_SIZE)
    fovValue.Font = Enum.Font.GothamMedium
    fovValue.TextSize = 12
    fovValue.TextColor3 = Color3.fromRGB(150, 150, 160)
    fovValue.TextXAlignment = Enum.TextXAlignment.Right
    fovValue.Parent = fovSection

    -- SLIDER FOV CLEAN E MODERNO
    local sliderBg = Instance.new("Frame")
    sliderBg.Size = UDim2.new(1, -50, 0, 4) -- MAIS FINO
    sliderBg.Position = UDim2.new(0, 0, 0, 35)
    sliderBg.BackgroundColor3 = Color3.fromRGB(45, 45, 55)
    sliderBg.BackgroundTransparency = 0.3 -- LEVE TRANSPARÊNCIA
    sliderBg.BorderSizePixel = 0
    sliderBg.Parent = fovSection

    local sliderCorner = Instance.new("UICorner")
    sliderCorner.CornerRadius = UDim.new(0, 2) -- MENOS ARREDONDADO
    sliderCorner.Parent = sliderBg

    -- SLIDER FILL COM EFEITO
    local sliderFill = Instance.new("Frame")
    sliderFill.Size = UDim2.fromScale((Config.FOV_SIZE - 30) / 120, 1)
    sliderFill.BackgroundColor3 = Color3.fromRGB(100, 150, 200)
    sliderFill.BackgroundTransparency = 0.2 -- TRANSPARÊNCIA PARA EFEITO
    sliderFill.BorderSizePixel = 0
    sliderFill.Parent = sliderBg

    local fillCorner = Instance.new("UICorner")
    fillCorner.CornerRadius = UDim.new(0, 2)
    fillCorner.Parent = sliderFill

    -- SLIDER HANDLE MODERNO
    local sliderHandle = Instance.new("Frame")
    sliderHandle.Size = UDim2.new(0, 10, 0, 14) -- FORMA MAIS ALTA QUE LARGA
    sliderHandle.Position = UDim2.fromScale((Config.FOV_SIZE - 30) / 120 - 0.04, -0.5)
    sliderHandle.BackgroundColor3 = Color3.fromRGB(220, 220, 230)
    sliderHandle.BackgroundTransparency = 0.1
    sliderHandle.BorderSizePixel = 0
    sliderHandle.Parent = sliderBg

    local handleCorner = Instance.new("UICorner")
    handleCorner.CornerRadius = UDim.new(0, 5) -- ARREDONDADO
    handleCorner.Parent = sliderHandle

    -- SOMBRA LEVE NO HANDLE
    local handleShadow = Instance.new("Frame")
    handleShadow.Size = UDim2.new(1, 2, 1, 2)
    handleShadow.Position = UDim2.new(0, -1, 0, -1)
    handleShadow.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
    handleShadow.BackgroundTransparency = 0.7
    handleShadow.BorderSizePixel = 0
    handleShadow.ZIndex = -1
    local shadowCorner = Instance.new("UICorner")
    shadowCorner.CornerRadius = UDim.new(0, 6)
    shadowCorner.Parent = handleShadow
    handleShadow.Parent = sliderHandle

    -- VARIÁVEIS DO SLIDER
    local minFOV = 30
    local maxFOV = 150
    local draggingSlider = false

    -- FUNÇÃO PARA ATUALIZAR SLIDER
    local function updateSlider()
        local percent = (Config.FOV_SIZE - minFOV) / (maxFOV - minFOV)
        sliderFill.Size = UDim2.fromScale(math.clamp(percent, 0, 1), 1)
        sliderHandle.Position = UDim2.fromScale(math.clamp(percent - 0.05, -0.05, 0.95), -0.25)
        fovValue.Text = tostring(Config.FOV_SIZE)
    end

    -- EVENTOS DO SLIDER
    sliderBg.InputBegan:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 then
            draggingSlider = true
            local percent = math.clamp((input.Position.X - sliderBg.AbsolutePosition.X) / sliderBg.AbsoluteSize.X, 0, 1)
            Config.FOV_SIZE = math.floor(minFOV + (maxFOV - minFOV) * percent)
            updateSlider()
        end
    end)

    sliderBg.InputEnded:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 then
            draggingSlider = false
        end
    end)

    sliderHandle.InputBegan:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 then
            draggingSlider = true
        end
    end)

    sliderHandle.InputEnded:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 then
            draggingSlider = false
        end
    end)

    -- ATUALIZAR SLIDER QUANDO MOUSE SE MOVE
    UIS.InputChanged:Connect(function(input)
        if draggingSlider and input.UserInputType == Enum.UserInputType.MouseMovement then
            local percent = math.clamp((input.Position.X - sliderBg.AbsolutePosition.X) / sliderBg.AbsoluteSize.X, 0, 1)
            Config.FOV_SIZE = math.floor(minFOV + (maxFOV - minFOV) * percent)
            updateSlider()
        end
    end)

    -- DRAG FUNCIONALITY
    header.InputBegan:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 then
            UIController.dragging = true
            UIController.dragStart = input.Position
            UIController.startPos = UIController.painel.Position
        end
    end)

    header.InputEnded:Connect(function(input)
        if input.UserInputType == Enum.UserInputType.MouseButton1 then
            UIController.dragging = false
        end
    end)

    UIS.InputChanged:Connect(function(input)
        if UIController.dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
            local camera = workspace.CurrentCamera
            if not camera then return end

            local delta = (input.Position - UIController.dragStart)
            local newPos = UDim2.new(
                UIController.startPos.X.Scale + (delta.X / camera.ViewportSize.X),
                0,
                UIController.startPos.Y.Scale + (delta.Y / camera.ViewportSize.Y),
                0
            )

            UIController.painel.Position = UDim2.fromScale(
                math.clamp(newPos.X.Scale, 0.1, 0.9),
                math.clamp(newPos.Y.Scale, 0.05, 0.9)
            )
        end
    end)

    -- FUNCIONALIDADES DOS BOTÕES COM ANIMAÇÕES (SEMPRE FUNCIONAM)
    -- FUNCIONALIDADE AIMBOT - LÓGICA SIMPLES E DIRETA
    aimToggle.MouseButton1Click:Connect(function()
        -- UMA ÚNICA VARIÁVEL CONTROLA TUDO
        WindowFocus.aimAtivo = not WindowFocus.aimAtivo

        -- VISUAL REFLETE DIRETAMENTE A VARIÁVEL (SEM DELAYS, SEM ANIMAÇÕES)
        aimToggle.BackgroundColor3 = WindowFocus.aimAtivo and Color3.fromRGB(0, 150, 0) or Color3.fromRGB(150, 0, 0)
        aimToggle.Text = WindowFocus.aimAtivo and "ENABLED" or "DISABLED"

        -- LIMPAR ALVO QUANDO DESATIVAR
        if not WindowFocus.aimAtivo then
            WindowFocus.alvoAtual = nil
        end

        print("🎯 AIMBOT:", WindowFocus.aimAtivo and "ENABLED" or "DISABLED")
    end)

    -- FUNCIONALIDADE ESP - LÓGICA SIMPLES E DIRETA
    espToggle.MouseButton1Click:Connect(function()
        -- UMA ÚNICA VARIÁVEL CONTROLA TUDO
        getgenv().ESP_Settings.Enabled = not getgenv().ESP_Settings.Enabled

        -- VISUAL REFLETE DIRETAMENTE A VARIÁVEL (SEM DELAYS, SEM ANIMAÇÕES)
        espToggle.BackgroundColor3 = getgenv().ESP_Settings.Enabled and Color3.fromRGB(0, 150, 0) or Color3.fromRGB(150, 0, 0)
        espToggle.Text = getgenv().ESP_Settings.Enabled and "ENABLED" or "DISABLED"

        print("👁️ ESP:", getgenv().ESP_Settings.Enabled and "ENABLED - PRESS RIGHT SHIFT TO TOGGLE" or "DISABLED")
    end)

    -- SEM EFEITOS HOVER - BOTÕES SIMPLES E DIRETOS

    -- TOGGLE UI DIRETO
    UIS.InputBegan:Connect(function(input, gameProcessed)
        if gameProcessed then return end
        if input.KeyCode == Enum.KeyCode.Insert then
            UIController.painel.Visible = not UIController.painel.Visible
        end
    end)
end

-- ========================================================================
-- [ CARREGAR ESP MELHORADO ]
-- ========================================================================
local function loadESP()
    print("🎨 CARREGANDO ESP MELHORADO...")

    -- GARANTIR QUE SETTINGS GLOBAIS EXISTAM ANTES DO CARREGAMENTO
    getgenv().ESP_Settings = getgenv().ESP_Settings or {
        Enabled = true,
        ToggleKey = Enum.KeyCode.RightShift,
        DistanciaLimite = 300,
        TeamCheck = true,
        TeamColor = Color3.fromRGB(0, 255, 0),
        EnemyColor = Color3.fromRGB(255, 0, 0),
        TextSize = 13,
        BoxThickness = 1
    }

    -- CARREGAR ESP VIA LOADSTRING
    local success, error = pcall(function()
        loadstring(game:HttpGet("https://raw.githubusercontent.com/ZiriloXXX/EspTLF/refs/heads/main/script.lua"))()
    end)

    if success then
        print("✅ ESP MELHORADO CARREGADO COM SUCESSO!")
        print("🔴 VERMELHO = INIMIGOS | 🟢 VERDE = ALIADOS")
        print("📦 BOX + NOME + DISTÂNCIA + HEALTH BAR")
        print("🎯 RIGHT SHIFT PARA TOGGLE DO ESP")
        print("🎛️ CONTROLE VIA BOTÃO NA INTERFACE")
    else
        print("❌ ERRO AO CARREGAR ESP:", error)
        print("🎯 AIMBOT FUNCIONARÁ NORMALMENTE SEM ESP")
    end
end

-- ========================================================================
-- [ INICIALIZAÇÃO ULTRA-RÁPIDA ]
-- ========================================================================
print("🎯 INICIALIZANDO AIMBOT CABEÇA ULTRA-FORTE + ESP SEPARADO...")

-- INICIALIZAR COMPONENTES
WindowFocus.inicializar()
FOVSystem.criarCirculo()
UIController.criar()

-- CARREGAR ESP MELHORADO (SEPARADO)
loadESP()

print("✅ SISTEMA CABEÇA ULTRA-FORTE INICIALIZADO!")
print("🎯 AIMLOCK: GRUDAÇÃO ULTRA-FORTE NA CABEÇA")
print("⚡ FOV CABEÇA RESTRITO: " .. Config.FOV_SIZE)
print("🔥 SUAVIZAÇÃO ULTRA-RÁPIDA: " .. Config.SMOOTHNESS)
print("💪 BONUS CABEÇA: " .. math.floor(Config.HEAD_BONUS_STRENGTH * 100) .. "% MAIS FORTE")
print("🎨 ESP: CARREGADO SEPARADAMENTE (RIGHT SHIFT)")
print("🎮 INSERT PARA HUB PREMIUM ANIMADO")
print("✨ EFEITOS VISUAIS: TRANSPARÊNCIAS + ANIMAÇÕES + GLOW")
print("👁️ BOTÃO ESP NA INTERFACE PARA ATIVAR/DESATIVAR")

-- ========================================================================
-- [ LOOP PRINCIPAL ULTRA-OTIMIZADO ] - SISTEMA DE ESTADOS
-- ========================================================================
RunService.RenderStepped:Connect(function()
    -- 🔥 VERIFICAÇÃO CRÍTICA DE FOCO - APENAS PARA AIMBOT
    -- NOTA: ESP funciona independente do foco via RIGHT SHIFT

    -- VALIDAR CÂMERA ULTRA-RÁPIDA
    local camera = GameDataSystem.getCamera()
    if not camera then return end

    local viewportCenter = GameDataSystem.getViewportSize(camera)
    if viewportCenter == Vector2.zero then return end
    viewportCenter = viewportCenter / 2

    -- 🔥 AIMLOCK LÓGICA ULTRA-PRECIOSA - CABEÇA SEMPRE
    -- SISTEMA BASEADO EM ESTADO: só executa se WindowFocus.aimAtivo = true
    if WindowFocus.aimAtivo then
        -- VERIFICAR SE JANELA ESTÁ EM FOCO (segurança para aimbot)
        if not WindowFocus.janelaEmFoco then
            return -- AIMBOT só funciona com foco
        end

        -- VALIDAR ALVO ATUAL CONSTANTEMENTE
        if WindowFocus.alvoAtual and not EnemyDetector.ehValido(WindowFocus.alvoAtual) then
            WindowFocus.alvoAtual = nil
        end

        -- PROCURAR MELHOR CABEÇA CONSTANTEMENTE
        if not WindowFocus.alvoAtual then
            WindowFocus.alvoAtual = TargetSelector.encontrarMelhor(camera)
        end

        -- APLICAR AIMLOCK NA CABEÇA
        if WindowFocus.alvoAtual then
            AimController.aplicar(WindowFocus.alvoAtual, camera)
        end
    end

    -- FOV VISUAL ULTRA-PRECIso (sempre ativo, independente de estados)
    FOVSystem.atualizar()
end)

print("🎯 AIMBOT CABEÇA ULTRA-FORTE OPERACIONAL!")
print("🔥 SEMPRE TRAVA NA CABEÇA COM FORÇA MÁXIMA")
print("⚡ PREDIÇÃO DE MOVIMENTO ATIVA (0ms)")
print("🎚️ SLIDER FOV CABEÇA FUNCIONAL (30-150)")
print("💪 BONUS CABEÇA: " .. math.floor(Config.HEAD_BONUS_STRENGTH * 100) .. "% MAIS FORTE")
print("🎨 ESP CARREGADO SEPARADAMENTE (RIGHT SHIFT)")
print("🚫 CURSOR SEGURO FORA DO ROBLOX")
print("🎮 HUB PREMIUM ANIMADO: TRANSPARÊNCIAS + EFEITOS VISUAIS")
print("✨ ANIMAÇÕES: CLIQUE + HOVER + GLOW + FADE/SLIDE")
print("⚡ GRUDAÇÃO ULTRA-FORTE: threshold mínimo + movimento máximo para cabeça")

Features & Information

ESP AIMLOCK V2

Community Comments (0)

No comments yet for this script.

More Scripts for Universal Scripts