local enabled = true local toggleKey = Enum.KeyCode.LeftAlt -- Changed from B to LeftAlt local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local player = Players.LocalPlayer local mouse = player:GetMouse() -- Settings local MAX_DISTANCE = 999999 -- More realistic range local CHECK_INTERVAL = 0.016 -- 20 times/sec local holdingMouse = false -- Toggle the triggerbot UserInputService.InputBegan:Connect(function(input, gameProcessed) if not gameProcessed and input.KeyCode == toggleKey then enabled = not enabled local hint = Instance.new("Hint") hint.Text = "Triggerbot: " .. (enabled and "Enabled" or "Disabled") hint.Parent = game:GetService("CoreGui") task.delay(1.5, function() hint:Destroy() end) end end) -- Helper: Find Head from clicked part local function getTargetHead(part) local model = part and part:FindFirstAncestorOfClass("Model") if model and model:FindFirstChild("Head") then return model.Head end return nil end -- Triggerbot loop RunService.Heartbeat:Connect(function() if not enabled then if holdingMouse then mouse1release() holdingMouse = false end return end local targetPart = mouse.Target if targetPart then local head = getTargetHead(targetPart) if head then local character = head.Parent local humanoid = character and character:FindFirstChildOfClass("Humanoid") local hrp = character and character:FindFirstChild("HumanoidRootPart") local targetPlayer = Players:GetPlayerFromCharacter(character) if humanoid and humanoid.Health > 0 and targetPlayer and targetPlayer ~= player and hrp then local myHRP = player.Character and player.Character:FindFirstChild("HumanoidRootPart") if myHRP then local distance = (myHRP.Position - hrp.Position).Magnitude if distance <= MAX_DISTANCE then if not holdingMouse then mouse1press() holdingMouse = true end return -- Exit early, still holding end end end end end -- If target lost or invalid, release mouse if holdingMouse then mouse1release() holdingMouse = false end end)