local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local player = Players.LocalPlayer local camera = workspace.CurrentCamera -- Estado do aimbot local aimbotEnabled = false local MAX_DISTANCE = 100 -- Criar o botão local screenGui = script.Parent screenGui.ResetOnSpawn = false local frame = Instance.new("ScreenGui") local frame = Instance.new("Frame") frame.Name = "AimbotFrame" frame.Size = UDim2.new(0, 150, 0, 50) frame.Position = UDim2.new(0, 20, 0, 20) frame.BackgroundColor3 = Color3.fromRGB(50, 50, 50) frame.BackgroundTransparency = 0.3 frame.BorderSizePixel = 0 frame.Parent = screenGui local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(0, 8) corner.Parent = frame local textButton = Instance.new("TextButton") textButton.Name = "AimbotButton" textButton.Size = UDim2.new(1, 0, 1, 0) textButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50) textButton.BackgroundTransparency = 0.5 textButton.BorderSizePixel = 0 textButton.Text = "Aimbot: OFF" textButton.TextColor3 = Color3.fromRGB(255, 255, 255) textButton.TextSize = 18 textButton.Font = Enum.Font.GothamBold textButton.Parent = frame local buttonCorner = Instance.new("UICorner") buttonCorner.CornerRadius = UDim.new(0, 8) buttonCorner.Parent = textButton -- Função para atualizar a aparência do botão local function updateButton() if aimbotEnabled then textButton.Text = "Aimbot: ON" textButton.BackgroundColor3 = Color3.fromRGB(50, 200, 50) else textButton.Text = "Aimbot: OFF" textButton.BackgroundColor3 = Color3.fromRGB(200, 50, 50) end end -- Função para encontrar o alvo mais próximo (inclui jogadores e Rigs/NPCs) local function findClosestTarget() local closestTarget = nil local closestDistance = MAX_DISTANCE local character = player.Character if not character then return nil end local humanoidRootPart = character:FindFirstChild("HumanoidRootPart") if not humanoidRootPart then return nil end local myPosition = humanoidRootPart.Position -- Buscar TODOS os Humanoids no Workspace (inclui jogadores e Rigs/NPCs) for _, descendant in pairs(workspace:GetDescendants()) do local humanoid = descendant:FindFirstChildOfClass("Humanoid") if humanoid and humanoid.Health > 0 then local targetCharacter = humanoid.Parent local targetHumanoidRootPart = targetCharacter:FindFirstChild("HumanoidRootPart") -- Verificar se não é o próprio jogador if targetHumanoidRootPart and targetCharacter ~= character then local distance = (targetHumanoidRootPart.Position - myPosition).Magnitude if distance < closestDistance then -- Verificar se está na linha de visão local rayParams = RaycastParams.new() rayParams.FilterDescendantsInstances = {character, targetCharacter} rayParams.FilterType = Enum.RaycastFilterType.Exclude local direction = targetHumanoidRootPart.Position - myPosition local rayResult = workspace:Raycast(myPosition, direction, rayParams) -- Se não houver obstrução ou o obstáculo for o próprio alvo if not rayResult or rayResult.Instance:IsDescendantOf(targetCharacter) then closestTarget = targetHumanoidRootPart closestDistance = distance end end end end end return closestTarget end -- Loop principal do aimbot RunService.RenderStepped:Connect(function(deltaTime) if not aimbotEnabled then return end local target = findClosestTarget() if target then -- Calcular a direção para o alvo local targetPosition = target.Position local currentCFrame = camera.CFrame -- Criar um novo CFrame que olha para o alvo local lookAtCFrame = CFrame.lookAt(currentCFrame.Position, targetPosition) -- Suavizar o movimento (opcional - ajuste o valor para mais/menos suavidade) local smoothness = 0.1 local newCFrame = currentCFrame:Lerp(lookAtCFrame, smoothness) -- Aplicar a nova rotação da câmera camera.CFrame = CFrame.new(currentCFrame.Position, newCFrame.LookVector * 1000 + currentCFrame.Position) end end) -- Evento do botão textButton.MouseButton1Click:Connect(function() aimbotEnabled = not aimbotEnabled updateButton() end) -- Atalho de teclado (opcional - pressione 'H' para ligar/desligar) UserInputService.InputBegan:Connect(function(input, gameProcessed) if gameProcessed then return end if input.KeyCode == Enum.KeyCode.H then aimbotEnabled = not aimbotEnabled updateButton() end end) -- Inicializar updateButton()