Auto clickDetector
Key RequiredUniversal

Auto clickDetector

Universal ScriptTengeManTengeMan 3.6K views 31 executesUpdated Dec 9, 2024
Unrated
00
Lua Script•45 lines (1553 chars)
-- Create GUI Elements
local ScreenGui = Instance.new("ScreenGui")
local ToggleButton = Instance.new("TextButton")

-- Parent GUI to Player's ScreenGui
ScreenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")

-- Setup Toggle Button
ToggleButton.Size = UDim2.new(0, 200, 0, 50)
ToggleButton.Position = UDim2.new(0.5, -100, 0.9, -25) -- Centered at the bottom
ToggleButton.Text = "Auto Click: OFF"
ToggleButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0) -- Red for OFF
ToggleButton.TextColor3 = Color3.fromRGB(255, 255, 255)
ToggleButton.Parent = ScreenGui

-- Variables
local autoClickEnabled = false

-- Function to toggle Auto Click
ToggleButton.MouseButton1Click:Connect(function()
    autoClickEnabled = not autoClickEnabled
    if autoClickEnabled then
        ToggleButton.Text = "Auto Click: ON"
        ToggleButton.BackgroundColor3 = Color3.fromRGB(0, 255, 0) -- Green for ON
        startAutoClick()
    else
        ToggleButton.Text = "Auto Click: OFF"
        ToggleButton.BackgroundColor3 = Color3.fromRGB(255, 0, 0) -- Red for OFF
    end
end)

-- Function to start auto-clicking
function startAutoClick()
    spawn(function()
        while autoClickEnabled do
            for _, part in ipairs(workspace:GetDescendants()) do
                if part:IsA("ClickDetector") and part.Parent then
                    fireclickdetector(part)
                    wait(0.1) -- Adjust the delay as needed
                end
            end
            wait(0.5) -- Delay between full scans of the workspace
        end
    end)
end

Features & Information

You can fire every clickDetector on the game

Community Comments (1)

nhip147231nhip147231Dec 13, 2024(edited)

Can i change the radius of autoclick

More Scripts for Universal Scripts