ProximityPrompt and ClickDetector Firer
Key RequiredUniversal

ProximityPrompt and ClickDetector Firer

Universal ScriptPOOIPOOPPOOIPOOP 3.4K views 260 executesUpdated May 26, 2025
2.5/ 5(4 votes)
2250% Positive
Lua Script•261 lines (8402 chars)
--[[
	WARNING: Heads up! This script has not been verified by ScriptBlox. Use at your own risk!
]]
-- Services
local Players          = game:GetService("Players")
local RunService       = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")

-- Player & Character
local LocalPlayer = Players.LocalPlayer
local character   = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()

-- R15/R6 fallback for HumanoidRootPart
local function resolveHRP(char)
    return char:FindFirstChild("HumanoidRootPart")
        or char:FindFirstChild("UpperTorso")
        or char:FindFirstChild("Torso")
end

local hrp = resolveHRP(character)

-- Configuration (editable via GUI)
local SCAN_RADIUS    = 15
local PROX_RADIUS    = 15
local INSTANT_METHOD = false
local AUTO_FIRE      = false
local TOGGLE_KEY     = Enum.KeyCode.RightControl

-- Helper: find world position of any interactable
local function getInteractablePosition(obj)
    if obj:IsA("BasePart") then
        return obj.Position
    end
    local part = obj:FindFirstAncestorWhichIsA("BasePart")
    if part then
        return part.Position
    end
    local mdl = obj:FindFirstAncestorWhichIsA("Model")
    if mdl then
        if mdl.PrimaryPart then
            return mdl.PrimaryPart.Position
        end
        local bp = mdl:FindFirstChildWhichIsA("BasePart", true)
        if bp then
            return bp.Position
        end
    end
    local att = obj:FindFirstAncestorWhichIsA("Attachment")
    if att then
        return att.WorldCFrame.Position
    end
    return nil
end

-- Enforce ProximityPrompt activation distance
local function enforcePromptRange()
    for _, p in ipairs(workspace:GetDescendants()) do
        if p:IsA("ProximityPrompt") then
            p.MaxActivationDistance = PROX_RADIUS
        end
    end
end
workspace.DescendantAdded:Connect(function(d)
    if d:IsA("ProximityPrompt") then
        d.MaxActivationDistance = PROX_RADIUS
    end
end)
enforcePromptRange()

-- Fire helpers
local function fireProximity(prompt)
    if INSTANT_METHOD then
        pcall(fireproximityprompt, prompt)
    else
        pcall(function()
            prompt:InputHoldBegin()
            task.wait(0.1)
            prompt:InputHoldEnd()
        end)
    end
end

local function fireClick(cd)
    pcall(fireclickdetector, cd, cd.Parent)
end

-- GUI (one‑time build)
local gui = Instance.new("ScreenGui", LocalPlayer:WaitForChild("PlayerGui"))
gui.Name = "AutoFireGui"
gui.ResetOnSpawn = false

local frame = Instance.new("Frame", gui)
frame.Size             = UDim2.new(0, 380, 0, 240)
frame.Position         = UDim2.new(0, 10, 0, 10)
frame.BackgroundColor3 = Color3.fromRGB(28,28,28)
frame.Active           = true
frame.Draggable        = true
Instance.new("UICorner", frame).CornerRadius = UDim.new(0,8)

-- Title
local title = Instance.new("TextLabel", frame)
title.Size              = UDim2.new(1, 0, 0, 24)
title.BackgroundColor3  = Color3.fromRGB(40,40,40)
title.TextColor3        = Color3.new(1,1,1)
title.Font              = Enum.Font.GothamBold
title.TextSize          = 18
title.TextXAlignment    = Enum.TextXAlignment.Left
title.Text              = " Auto‑Fire Scanner"

-- Info
local info = Instance.new("TextLabel", frame)
info.Position           = UDim2.new(0, 5, 0, 30)
info.Size               = UDim2.new(1, -10, 0, 45)
info.BackgroundTransparency = 1
info.TextColor3         = Color3.new(1,1,1)
info.Font               = Enum.Font.Gotham
info.TextSize           = 14
info.TextWrapped        = true
info.Text               = "Nearest: none"

-- Labeled TextBox helper
local function newLabeledBox(y, labelText, default, onChange)
    local lbl = Instance.new("TextLabel", frame)
    lbl.Position        = UDim2.new(0.05, 0, 0, y)
    lbl.Size            = UDim2.new(0.4, -10, 0, 20)
    lbl.BackgroundTransparency = 1
    lbl.Text            = labelText
    lbl.TextColor3      = Color3.new(1,1,1)
    lbl.Font            = Enum.Font.Gotham
    lbl.TextSize        = 14
    lbl.TextXAlignment  = Enum.TextXAlignment.Left

    local box = Instance.new("TextBox", frame)
    box.Position        = UDim2.new(0.55, 0, 0, y)
    box.Size            = UDim2.new(0.4, 0, 0, 20)
    box.Text            = tostring(default)
    box.ClearTextOnFocus= false
    box.BackgroundColor3= Color3.fromRGB(50,50,50)
    box.TextColor3      = Color3.new(1,1,1)
    box.Font            = Enum.Font.Gotham
    box.TextSize        = 14
    Instance.new("UICorner", box).CornerRadius = UDim.new(0,6)

    box.FocusLost:Connect(function(enter)
        if enter then
            local v = tonumber(box.Text)
            if v and v > 0 then
                onChange(v)
            else
                box.Text = tostring(default)
            end
        end
    end)
    return box
end

local scanBox = newLabeledBox(80,  "Scan Radius",              SCAN_RADIUS, function(v) SCAN_RADIUS = v end)
local proxBox = newLabeledBox(105, "ProximityPrompt Radius", PROX_RADIUS, function(v)
    PROX_RADIUS = v
    enforcePromptRange()
end)

-- Button factory
local function newButton(text, posX, color)
    local b = Instance.new("TextButton", frame)
    b.Size             = UDim2.new(0.25, 0, 0, 35)
    b.Position         = UDim2.new(posX, 0, 1, -45)
    b.BackgroundColor3 = color
    b.TextColor3       = Color3.new(1,1,1)
    b.Font             = Enum.Font.GothamBold
    b.TextSize         = 16
    b.Text             = text
    Instance.new("UICorner", b).CornerRadius = UDim.new(0,6)
    return b
end

local useBtn    = newButton("Use",          0.05, Color3.fromRGB(0,170,0))
local methodBtn = newButton("Method: Hold", 0.36, Color3.fromRGB(70,70,70))
local autoBtn   = newButton("Auto: Off",    0.67, Color3.fromRGB(70,70,70))

useBtn.MouseButton1Click:Connect(function()
    if currentTarget then
        if currentTarget:IsA("ProximityPrompt") then
            fireProximity(currentTarget)
        else
            fireClick(currentTarget)
        end
    end
end)

methodBtn.MouseButton1Click:Connect(function()
    INSTANT_METHOD = not INSTANT_METHOD
    methodBtn.Text = INSTANT_METHOD and "Method: Instant" or "Method: Hold"
    methodBtn.BackgroundColor3 = INSTANT_METHOD and Color3.fromRGB(0,170,0) or Color3.fromRGB(70,70,70)
end)

autoBtn.MouseButton1Click:Connect(function()
    AUTO_FIRE = not AUTO_FIRE
    autoBtn.Text = AUTO_FIRE and "Auto: On" or "Auto: Off"
    autoBtn.BackgroundColor3 = AUTO_FIRE and Color3.fromRGB(0,170,0) or Color3.fromRGB(70,70,70)
end)

-- Toggle GUI
UserInputService.InputBegan:Connect(function(input, gp)
    if not gp and input.KeyCode == TOGGLE_KEY then
        gui.Enabled = not gui.Enabled
    end
end)

-- Respawn handler
LocalPlayer.CharacterAdded:Connect(function(char)
    character = char
    hrp = resolveHRP(char)
    currentTarget = nil
end)

task.spawn(function()
    while true do
        task.wait(0.1)

        -- Re-acquire HRP if missing (mid‑session death/rerig)
        if not hrp or not hrp.Parent then
            character = LocalPlayer.Character or LocalPlayer.CharacterAdded:Wait()
            hrp = resolveHRP(character)
            currentTarget = nil
        end

        if hrp and hrp.Parent then
            local nearest, kind, bestDist = nil, nil, SCAN_RADIUS
            for _, obj in ipairs(workspace:GetDescendants()) do
                if obj:IsA("ProximityPrompt") or obj:IsA("ClickDetector") then
                    local pos = getInteractablePosition(obj)
                    if pos then
                        local d = (pos - hrp.Position).Magnitude
                        if d <= SCAN_RADIUS and d <= bestDist then
                            nearest, kind, bestDist = obj, obj.ClassName, d
                        end
                    end
                end
            end

            if nearest then
                currentTarget = nearest
                info.Text = string.format(
                    "Nearest: %s on \"%s\"\n(%.1f studs)",
                    kind, nearest.Parent.Name, bestDist
                )
                if AUTO_FIRE then
                    if kind == "ProximityPrompt" then
                        fireProximity(nearest)
                    else
                        fireClick(nearest)
                    end
                end
            else
                currentTarget = nil
                info.Text = "Nearest: none"
            end
        end
    end
end)

Features & Information

gui that shows the nearest prox prompts or cd near you and you can fire it (buttons: use/ method/ loop) idk if this works

Community Comments (4)

tweetytweetyMay 26, 2025

yo bro can you add fire nearest click detector script is so good

TCESTeam_IAmFriendlyTCESTeam_IAmFriendlyMay 27, 2025(edited)

YOU THIEF! YOU ABSOLUTE THIEF YOU STOLE MY SCRIPT YOU LITERAL STEALER

YOU STEAL OTHER SCRIPTS TOO

POOIPOOPPOOIPOOPMay 28, 2025

... i want your script to be used by everyone

More Scripts for Universal Scripts