Volt

fireproximityprompt

Triggers a ProximityPrompt as if it was activated.

Syntax

fireproximityprompt(prompt: ProximityPrompt, amount?: number, skip?: boolean) -> void

Parameters

ParameterTypeDescription
promptProximityPromptThe ProximityPrompt to fire
amountnumber?Number of times to trigger (default: 1)
skipboolean?Skip the hold duration (default: true)

Returns

This function does not return a value.

Description

fireproximityprompt simulates activation of a ProximityPrompt, bypassing distance and hold time requirements.

Example

-- Find a ProximityPrompt
local prompt = workspace.Door.ProximityPrompt

-- Fire it once
fireproximityprompt(prompt)

-- Fire it 5 times
fireproximityprompt(prompt, 5)

-- Fire without skipping hold duration
fireproximityprompt(prompt, 1, false)

Auto-Activate All Prompts

local function fireAllPrompts(parent)
    for _, desc in ipairs(parent:GetDescendants()) do
        if desc:IsA("ProximityPrompt") then
            fireproximityprompt(desc)
        end
    end
end

fireAllPrompts(workspace)

Notes

  • By default, the hold duration is skipped
  • The amount parameter is useful for prompts that need multiple activations

On this page