-- Auto Clicker (settings editable at top or in the GUI) local Settings = { CPS = 10, -- clicks per second Hotkey = Enum.KeyCode.F, -- PC toggle key ClickAtCursor = true -- false = click screen center } local Players = game:GetService("Players") local UIS = game:GetService("UserInputService") local VIM = game:GetService("VirtualInputManager") local RunService = game:GetService("RunService") local parent = (gethui and gethui()) or game:GetService("CoreGui") local old = parent:FindFirstChild("AutoClickerGui") if old then old:Destroy() end local running = false -- GUI local gui = Instance.new("ScreenGui") gui.Name = "AutoClickerGui" gui.ResetOnSpawn = false gui.Parent = parent local frame = Instance.new("Frame") frame.Size = UDim2.new(0, 190, 0, 120) frame.Position = UDim2.new(0.5, -95, 0.2, 0) frame.BackgroundColor3 = Color3.fromRGB(30, 30, 36) frame.BorderSizePixel = 0 frame.Active = true frame.Draggable = true frame.Parent = gui Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 8) local function label(text, y) local l = Instance.new("TextLabel") l.Size = UDim2.new(1, 0, 0, 22) l.Position = UDim2.new(0, 0, 0, y) l.BackgroundTransparency = 1 l.Text = text l.TextColor3 = Color3.new(1, 1, 1) l.Font = Enum.Font.GothamBold l.TextSize = 14 l.Parent = frame return l end label("Auto Clicker", 4) local cpsLabel = label("CPS:", 34) cpsLabel.Size = UDim2.new(0, 50, 0, 22) cpsLabel.Position = UDim2.new(0, 10, 0, 34) local box = Instance.new("TextBox") box.Size = UDim2.new(0, 60, 0, 24) box.Position = UDim2.new(0, 60, 0, 33) box.BackgroundColor3 = Color3.fromRGB(50, 50, 60) box.TextColor3 = Color3.new(1, 1, 1) box.Text = tostring(Settings.CPS) box.Font = Enum.Font.Gotham box.TextSize = 14 box.ClearTextOnFocus = false box.Parent = frame Instance.new("UICorner", box) local function stepBtn(txt, x, delta) local b = Instance.new("TextButton") b.Size = UDim2.new(0, 24, 0, 24) b.Position = UDim2.new(0, x, 0, 33) b.BackgroundColor3 = Color3.fromRGB(70, 70, 85) b.Text = txt b.TextColor3 = Color3.new(1, 1, 1) b.Font = Enum.Font.GothamBold b.TextSize = 16 b.Parent = frame Instance.new("UICorner", b) b.MouseButton1Click:Connect(function() Settings.CPS = math.clamp(Settings.CPS + delta, 1, 100) box.Text = tostring(Settings.CPS) end) end stepBtn("-", 126, -1) stepBtn("+", 154, 1) box.FocusLost:Connect(function() local n = tonumber(box.Text) Settings.CPS = math.clamp(n or Settings.CPS, 1, 100) box.Text = tostring(Settings.CPS) end) local toggle = Instance.new("TextButton") toggle.Size = UDim2.new(1, -20, 0, 32) toggle.Position = UDim2.new(0, 10, 0, 74) toggle.BackgroundColor3 = Color3.fromRGB(180, 60, 60) toggle.Text = "OFF" toggle.TextColor3 = Color3.new(1, 1, 1) toggle.Font = Enum.Font.GothamBold toggle.TextSize = 16 toggle.Parent = frame Instance.new("UICorner", toggle) local function setRunning(state) running = state toggle.Text = running and "ON" or "OFF" toggle.BackgroundColor3 = running and Color3.fromRGB(60, 170, 80) or Color3.fromRGB(180, 60, 60) end toggle.MouseButton1Click:Connect(function() setRunning(not running) end) UIS.InputBegan:Connect(function(input, gp) if gp then return end if input.KeyCode == Settings.Hotkey then setRunning(not running) end end) -- Click loop local function click() local pos if Settings.ClickAtCursor then pos = UIS:GetMouseLocation() else local v = workspace.CurrentCamera.ViewportSize pos = Vector2.new(v.X / 2, v.Y / 2) end VIM:SendMouseButtonEvent(pos.X, pos.Y, 0, true, game, 0) VIM:SendMouseButtonEvent(pos.X, pos.Y, 0, false, game, 0) end task.spawn(function() while gui.Parent do if running then pcall(click) task.wait(1 / Settings.CPS) else task.wait(0.1) end end end)