# Prompt

For examples on how to use, refer to [PromptService](https://docs.easy.gg/scripting/bedwars-scripting/services/promptservice).

Creates a Roblox [ProximityPrompt](https://create.roblox.com/docs/reference/engine/classes/ProximityPrompt).

### Functions

#### onActivated(function: (player: [Player](https://docs.easy.gg/scripting/bedwars-scripting/objects/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](https://create.roblox.com/docs/reference/engine/enums/KeyCode))

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

#### setPosition(position: [Vector3](https://create.roblox.com/docs/reference/engine/datatypes/Vector3))

Sets the position of the prompt.

#### getPosition(): [Vector3](https://create.roblox.com/docs/reference/engine/datatypes/Vector3)

Returns the position of the prompt.

#### destroy()

Destroys the prompt.
