fireproximityprompt
Triggers a ProximityPrompt as if it was activated.
Syntax
fireproximityprompt(prompt: ProximityPrompt) -> ()Parameters
| Parameter | Type | Description |
|---|---|---|
prompt | ProximityPrompt | The ProximityPrompt to fire |
Returns
This function does not return a value.
Description
fireproximityprompt simulates activation of a ProximityPrompt, bypassing distance and hold time requirements.
Example
local part = Instance.new("Part")
part.Parent = workspace
local prompt = Instance.new("ProximityPrompt")
prompt.Parent = part
fireproximityprompt(prompt)
part:Destroy()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)The function bypasses both activation distance and HoldDuration. Call it once for each activation you want to simulate.