Comment on page

Prompt

An in-world ProximityPrompt.
For examples on how to use, refer to PromptService.
Creates a Roblox ProximityPrompt.

Functions

onActivated(function: (player: Player) => nil)

Registers a function to run when the prompt is activated.

setObjectText(objectText: string)

Sets the object text. Example: Door

setActionText(actionText: string)

Sets the action text. Example: Open

setActivationDistance(activationDistance: number)

Sets the activation distance in studs. Only players within this distance can use the prompt.

setHoldDuration(holdDurationSec: number)

Sets the duration (in seconds) of hold time needed to activate the prompt.

setKeyCode(keyCode: KeyCode)

Specifies the key code used to activate the prompt. Written as KeyCode.X.

setPosition(position: Vector3)

Sets the position of the prompt.

getPosition(): Vector3​

Returns the position of the prompt.

destroy()

Destroys the prompt.
Last modified 3mo ago