ProximityPromptService

ProximityPromptService : Instance

Overview

A service that globally manages all ProximityPrompts in the world.

It can be obtained via game:GetService("ProximityPromptService").

By listening to events through this service instead of individual ProximityPrompt instances, you can handle all prompt interactions in the world from a single location.

Properties

Enabled

boolean

Enables or disables the ProximityPrompt feature for the entire service.

Setting this to false hides all prompts in the world.

Code Samples

local ProximityPromptService = game:GetService("ProximityPromptService")
ProximityPromptService.Enabled = false

MaxPromptsVisible

number

The maximum number of prompts that can be displayed on screen simultaneously.

Code Samples

Methods

Events

PromptButtonHoldBegan

This event fires when a player begins holding the button for any ProximityPrompt in the world.

Parameters

ProximityPrompt prompt

The ProximityPrompt instance.

Player player

The player who started holding the button.

Code Samples

PromptButtonHoldEnded

This event fires when a player releases the button for any ProximityPrompt in the world.

Parameters

ProximityPrompt prompt

The ProximityPrompt instance.

Player player

The player who released the button.

Code Samples

PromptHidden

This event fires when any ProximityPrompt in the world is hidden.

This event only functions in the client environment.

Parameters

ProximityPrompt prompt

The ProximityPrompt instance that was hidden.

Code Samples

PromptShown

This event fires when any ProximityPrompt in the world becomes visible.

This event only functions in the client environment.

Parameters

ProximityPrompt prompt

The ProximityPrompt instance that was shown.

Code Samples

PromptTriggered

This event fires when any ProximityPrompt in the world is activated.

Parameters

ProximityPrompt prompt

The ProximityPrompt instance that was activated.

Player player

The player who activated the prompt.

Code Samples

PromptTriggerEnded

This event fires when an in-progress ProximityPrompt trigger completes or is cancelled.

Parameters

ProximityPrompt prompt

The ProximityPrompt instance.

Player player

The related player.

Code Samples

Last updated