local fov = 52 local headoffset = Vector3.new(0, 1.5, 0) local rootoffset = Vector3.new(0, 0.1, 0) local maxraydistance = 2000 local predictionfactor = 0.035 local smoothfactor = 0.96 local shakemagnitude = 0.0045 local referenceheight = 1080 local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local Cam = workspace.CurrentCamera local Player = game:GetService("Players").LocalPlayer local FOVring = Drawing.new("Circle") FOVring.Visible = false FOVring.Thickness = 2 FOVring.Color = Color3.fromRGB(128, 0, 128) FOVring.Filled = false FOVring.Radius = fov FOVring.Position = Cam.ViewportSize / 2 local isAiming = false local validPlayers = {} local espEnabled = false local teamColorESP = false local aimOnlyEnemies = false local espObjects = {} local ScreenGui = Instance.new("ScreenGui") ScreenGui.Parent = game.CoreGui local ToggleButton = Instance.new("TextButton") ToggleButton.Size = UDim2.new(0, 120, 0, 40) ToggleButton.Position = UDim2.new(0, 10, 0, 10) ToggleButton.Text = "AIMBOT: OFF" ToggleButton.BackgroundColor3 = Color3.fromRGB(30, 30, 30) ToggleButton.TextColor3 = Color3.fromRGB(255, 50, 50) ToggleButton.Font = Enum.Font.GothamBold ToggleButton.TextSize = 14 ToggleButton.Parent = ScreenGui local draggingToggle = false local dragStartToggle = nil local startPosToggle = nil ToggleButton.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then draggingToggle = true dragStartToggle = input.Position startPosToggle = ToggleButton.Position end end) ToggleButton.InputChanged:Connect(function(input) if (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) and draggingToggle then local delta = input.Position - dragStartToggle ToggleButton.Position = UDim2.new(startPosToggle.X.Scale, startPosToggle.X.Offset + delta.X, startPosToggle.Y.Scale, startPosToggle.Y.Offset + delta.Y) end end) ToggleButton.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then draggingToggle = false end end) local SetKeyButton = Instance.new("TextButton") SetKeyButton.Size = UDim2.new(0, 120, 0, 40) SetKeyButton.Position = UDim2.new(0, 10, 0, 60) SetKeyButton.Text = "Set Key: None" SetKeyButton.BackgroundColor3 = Color3.fromRGB(30, 30, 30) SetKeyButton.TextColor3 = Color3.fromRGB(255, 255, 255) SetKeyButton.Font = Enum.Font.GothamBold SetKeyButton.TextSize = 14 SetKeyButton.Parent = ScreenGui local draggingKey = false local dragStartKey = nil local startPosKey = nil SetKeyButton.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then draggingKey = true dragStartKey = input.Position startPosKey = SetKeyButton.Position end end) SetKeyButton.InputChanged:Connect(function(input) if (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) and draggingKey then local delta = input.Position - dragStartKey SetKeyButton.Position = UDim2.new(startPosKey.X.Scale, startPosKey.X.Offset + delta.X, startPosKey.Y.Scale, startPosKey.Y.Offset + delta.Y) end end) SetKeyButton.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then draggingKey = false end end) local ESPButton = Instance.new("TextButton") ESPButton.Size = UDim2.new(0, 120, 0, 40) ESPButton.Position = UDim2.new(0, 10, 0, 110) ESPButton.Text = "ESP: OFF" ESPButton.BackgroundColor3 = Color3.fromRGB(30, 30, 30) ESPButton.TextColor3 = Color3.fromRGB(255, 50, 50) ESPButton.Font = Enum.Font.GothamBold ESPButton.TextSize = 14 ESPButton.Parent = ScreenGui local draggingESP = false local dragStartESP = nil local startPosESP = nil ESPButton.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then draggingESP = true dragStartESP = input.Position startPosESP = ESPButton.Position end end) ESPButton.InputChanged:Connect(function(input) if (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) and draggingESP then local delta = input.Position - dragStartESP ESPButton.Position = UDim2.new(startPosESP.X.Scale, startPosESP.X.Offset + delta.X, startPosESP.Y.Scale, startPosESP.Y.Offset + delta.Y) end end) ESPButton.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then draggingESP = false end end) local TeamColorButton = Instance.new("TextButton") TeamColorButton.Size = UDim2.new(0, 120, 0, 40) TeamColorButton.Position = UDim2.new(0, 10, 0, 160) TeamColorButton.Text = "Team Color: OFF" TeamColorButton.BackgroundColor3 = Color3.fromRGB(30, 30, 30) TeamColorButton.TextColor3 = Color3.fromRGB(255, 50, 50) TeamColorButton.Font = Enum.Font.GothamBold TeamColorButton.TextSize = 14 TeamColorButton.Parent = ScreenGui local draggingTeam = false local dragStartTeam = nil local startPosTeam = nil TeamColorButton.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then draggingTeam = true dragStartTeam = input.Position startPosTeam = TeamColorButton.Position end end) TeamColorButton.InputChanged:Connect(function(input) if (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) and draggingTeam then local delta = input.Position - dragStartTeam TeamColorButton.Position = UDim2.new(startPosTeam.X.Scale, startPosTeam.X.Offset + delta.X, startPosTeam.Y.Scale, startPosTeam.Y.Offset + delta.Y) end end) TeamColorButton.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then draggingTeam = false end end) local AimEnemiesButton = Instance.new("TextButton") AimEnemiesButton.Size = UDim2.new(0, 120, 0, 40) AimEnemiesButton.Position = UDim2.new(0, 10, 0, 210) AimEnemiesButton.Text = "Aim Enemies: OFF" AimEnemiesButton.BackgroundColor3 = Color3.fromRGB(30, 30, 30) AimEnemiesButton.TextColor3 = Color3.fromRGB(255, 50, 50) AimEnemiesButton.Font = Enum.Font.GothamBold AimEnemiesButton.TextSize = 14 AimEnemiesButton.Parent = ScreenGui local draggingAim = false local dragStartAim = nil local startPosAim = nil AimEnemiesButton.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then draggingAim = true dragStartAim = input.Position startPosAim = AimEnemiesButton.Position end end) AimEnemiesButton.InputChanged:Connect(function(input) if (input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch) and draggingAim then local delta = input.Position - dragStartAim AimEnemiesButton.Position = UDim2.new(startPosAim.X.Scale, startPosAim.X.Offset + delta.X, startPosAim.Y.Scale, startPosAim.Y.Offset + delta.Y) end end) AimEnemiesButton.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then draggingAim = false end end) local waitingForKey = false local toggleKey = nil SetKeyButton.MouseButton1Click:Connect(function() waitingForKey = true SetKeyButton.Text = "Press a key or right-click..." end) UserInputService.InputBegan:Connect(function(input, gameProcessed) if waitingForKey then if input.UserInputType == Enum.UserInputType.Keyboard then toggleKey = input.KeyCode SetKeyButton.Text = "Set Key: " .. input.KeyCode.Name waitingForKey = false elseif input.UserInputType == Enum.UserInputType.MouseButton2 then toggleKey = "MouseButton2" SetKeyButton.Text = "Set Key: Right Mouse" waitingForKey = false end elseif not gameProcessed then if (toggleKey and toggleKey ~= "MouseButton2" and input.KeyCode == toggleKey) or (toggleKey == "MouseButton2" and input.UserInputType == Enum.UserInputType.MouseButton2) then isAiming = not isAiming FOVring.Visible = isAiming ToggleButton.Text = "AIMBOT: " .. (isAiming and "ON" or "OFF") ToggleButton.TextColor3 = isAiming and Color3.fromRGB(50, 255, 50) or Color3.fromRGB(255, 50, 50) end end end) ToggleButton.MouseButton1Click:Connect(function() isAiming = not isAiming FOVring.Visible = isAiming ToggleButton.Text = "AIMBOT: " .. (isAiming and "ON" or "OFF") ToggleButton.TextColor3 = isAiming and Color3.fromRGB(50, 255, 50) or Color3.fromRGB(255, 50, 50) end) ESPButton.MouseButton1Click:Connect(function() espEnabled = not espEnabled ESPButton.Text = "ESP: " .. (espEnabled and "ON" or "OFF") ESPButton.TextColor3 = espEnabled and Color3.fromRGB(50, 255, 50) or Color3.fromRGB(255, 50, 50) if not espEnabled then for _, esp in pairs(espObjects) do esp.box.Visible = false esp.name.Visible = false end end end) TeamColorButton.MouseButton1Click:Connect(function() teamColorESP = not teamColorESP TeamColorButton.Text = "Team Color: " .. (teamColorESP and "ON" or "OFF") TeamColorButton.TextColor3 = teamColorESP and Color3.fromRGB(50, 255, 50) or Color3.fromRGB(255, 50, 50) end) AimEnemiesButton.MouseButton1Click:Connect(function() aimOnlyEnemies = not aimOnlyEnemies AimEnemiesButton.Text = "Aim Enemies: " .. (aimOnlyEnemies and "ON" or "OFF") AimEnemiesButton.TextColor3 = aimOnlyEnemies and Color3.fromRGB(50, 255, 50) or Color3.fromRGB(255, 50, 50) end) local function isValidPlayer(player) if player == Player then return false end local character = player.Character if character then local humanoid = character:FindFirstChild("Humanoid") return humanoid and humanoid.Health > 1 and character:FindFirstChild("Head") and character:FindFirstChild("HumanoidRootPart") end return false end local function updateValidPlayers() validPlayers = {} for _, player in ipairs(game:GetService("Players"):GetPlayers()) do if isValidPlayer(player) then table.insert(validPlayers, player) end end end local function getHeadPosition(targetCharacter) local head = targetCharacter:FindFirstChild("Head") if head then return head.Position end local humanoidRootPart = targetCharacter:FindFirstChild("HumanoidRootPart") return humanoidRootPart and (humanoidRootPart.Position + headoffset) end local function checkTargetVisibility(targetCharacter) local headPos = getHeadPosition(targetCharacter) if not headPos then return false end local raycastParams = RaycastParams.new() raycastParams.FilterType = Enum.RaycastFilterType.Blacklist raycastParams.FilterDescendantsInstances = {Player.Character or {}} local rayResult = workspace:Raycast(Cam.CFrame.Position, (headPos - Cam.CFrame.Position).Unit * maxraydistance, raycastParams) if rayResult and rayResult.Instance then if rayResult.Instance:IsDescendantOf(targetCharacter) then return true end end return false end local function getOptimalTarget() local nearest = nil local minDistance = math.huge local viewportCenter = Cam.ViewportSize / 2 local character = Player.Character local playerRoot = character and character:FindFirstChild("HumanoidRootPart") if not playerRoot then return nil end for _, player in ipairs(validPlayers) do local targetCharacter = player.Character if targetCharacter then local humanoid = targetCharacter:FindFirstChild("Humanoid") if humanoid and humanoid.Health > 1 then if not aimOnlyEnemies or player.Team ~= Player.Team then if checkTargetVisibility(targetCharacter) then local headPos = getHeadPosition(targetCharacter) local humanoidRootPart = targetCharacter:FindFirstChild("HumanoidRootPart") if humanoidRootPart then local velocity = humanoidRootPart.Velocity local predictedPos = headPos + (velocity * predictionfactor) + rootoffset local screenPos = Cam:WorldToViewportPoint(predictedPos) if screenPos.Z > 0 then local distance = (Vector2.new(screenPos.X, screenPos.Y) - viewportCenter).Magnitude if distance < fov then if distance < minDistance then minDistance = distance nearest = targetCharacter end end end end end end end end end return nearest end local function smoothAim(targetCharacter) local headPos = getHeadPosition(targetCharacter) if not headPos then return end local humanoidRootPart = targetCharacter:FindFirstChild("HumanoidRootPart") if not humanoidRootPart then return end local velocity = humanoidRootPart.Velocity local predictedPos = headPos + (velocity * predictionfactor) + rootoffset local currentCF = Cam.CFrame local targetDirection = (predictedPos - currentCF.Position).Unit local newLookVector = currentCF.LookVector:Lerp(targetDirection, smoothfactor) local random_right = math.random() * 2 - 1 local random_up = math.random() * 2 - 1 local shake_vector = (currentCF.RightVector * random_right + currentCF.UpVector * random_up) * shakemagnitude local final_look_vector = (newLookVector + shake_vector).Unit Cam.CFrame = CFrame.new(currentCF.Position, currentCF.Position + final_look_vector) end local function createESP(player) local box = Drawing.new("Square") box.Thickness = 2 box.Filled = false box.Color = Color3.new(1, 1, 1) box.Visible = false local name = Drawing.new("Text") name.Size = 12 name.Center = true name.Outline = true name.Color = Color3.new(1, 1, 1) name.Visible = false espObjects[player] = {box = box, name = name} end local function updateESP() for player, esp in pairs(espObjects) do local character = player.Character if character and character:FindFirstChild("HumanoidRootPart") and espEnabled then local root = character:FindFirstChild("HumanoidRootPart") local screenPos, onScreen = Cam:WorldToViewportPoint(root.Position) if onScreen then local size = (Cam:WorldToViewportPoint(root.Position - Vector3.new(0, 3, 0)).Y - Cam:WorldToViewportPoint(root.Position + Vector3.new(0, 2.5, 0)).Y) / 2 esp.box.Size = Vector2.new(size * 1.5, size * 2) esp.box.Position = Vector2.new(screenPos.X - size * 0.75, screenPos.Y - size) esp.name.Position = Vector2.new(screenPos.X, screenPos.Y - size - 15) esp.name.Text = player.Name esp.box.Color = teamColorESP and player.Team and player.Team.TeamColor.Color or Color3.new(1, 1, 1) esp.box.Visible = true esp.name.Visible = true else esp.box.Visible = false esp.name.Visible = false end end end end RunService.Heartbeat:Connect(function() FOVring.Position = Cam.ViewportSize / 2 FOVring.Radius = fov * (Cam.ViewportSize.Y / referenceheight) if isAiming then local target = getOptimalTarget() if target then smoothAim(target) end end if espEnabled then updateESP() end end) local function initialize() updateValidPlayers() for _, player in ipairs(game:GetService("Players"):GetPlayers()) do if player ~= Player then createESP(player) end end game:GetService("Players").PlayerAdded:Connect(function(player) if player ~= Player then createESP(player) end task.wait(0.5) updateValidPlayers() end) game:GetService("Players").PlayerRemoving:Connect(function(player) if espObjects[player] then espObjects[player].box:Remove() espObjects[player].name:Remove() espObjects[player] = nil end updateValidPlayers() end) end initialize()