fireproximityprompt
Triggers a ProximityPrompt as if it was activated.
Syntax
fireproximityprompt(prompt: ProximityPrompt, amount?: number, skip?: boolean) -> voidParameters
| Parameter | Type | Description |
|---|---|---|
prompt | ProximityPrompt | The ProximityPrompt to fire |
amount | number? | Number of times to trigger (default: 1) |
skip | boolean? | 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
amountparameter is useful for prompts that need multiple activations