getproximitypromptduration Synchronous

Read how long the player must hold a ProximityPrompt before it triggers. Use it before a temporary change so the original duration can be restored.

Syntax
Luau
getproximitypromptduration(prompt: ProximityPrompt) -> number

Parameters

Function parameters
ParameterTypeDescription
promptProximityPromptProximityPrompt to inspect.

Returns

number

The prompt’s HoldDuration in seconds.

Usage notes

The wrapper reads the regular HoldDuration property and rejects non-prompt Instances.

Example

Example
Luau
local prompt = Instance.new("ProximityPrompt")
print("Hold for", getproximitypromptduration(prompt), "seconds")
prompt:Destroy()
Kawaii documentation