Properties
string
|
The action text shown to the user |
bool
|
Whether the prompt’s |
bool
|
Whether the prompt can be activated by clicking/tapping on the prompt UI |
bool
|
Whether this prompt should be shown |
ProximityPromptExclusivity
|
Used to customize which prompts can be shown at the same time |
KeyCode
|
The gamepad button the player should press to trigger the prompt |
float
|
The duration, in seconds, that the player must hold the button/key down to trigger the prompt |
KeyCode
|
The key the player should press to trigger the prompt |
float
|
The maximum distance a Player’s |
string
|
An optional property that determines the object name text shown to the user |
bool
|
Whether the prompt is hidden if the path between the player’s |
LocalizationTable
|
A reference to a |
ProximityPromptStyle
|
The style of the prompt’s UI |
Vector2
|
The pixel offset applied to the prompt’s UI |
bool
|
Determines if an |
string
[ReadOnly]
[NotReplicated]
|
A read-only string representing the class this |
int
[ReadOnly]
[NotReplicated]
[Deprecated]
|
The cost of saving the instance using data persistence. |
string
|
A non-unique identifier of the |
Instance
[NotReplicated]
|
Determines the hierarchical parent of the |
bool
|
A deprecated property that used to protect |
bool
[Hidden]
[NotReplicated]
[Deprecated]
|
string
[ReadOnly]
[NotReplicated]
[Deprecated]
|
Functions
void
|
Fires a signal indicating that the user began pressing the prompt GUI button |
void
|
Fires a signal indicating that the user ended pressing the prompt GUI button |
void
|
This function destroys all of an |
Instance
|
Create a copy of an object and all its descendants, ignoring objects that are not |
void
|
Sets the |
Instance
|
Returns the first ancestor of the |
Instance
|
Returns the first ancestor of the |
Instance
|
Returns the first ancestor of the |
Instance
|
Returns the first child of the |
Instance
|
Returns the first child of the |
Instance
|
Returns the first child of the |
Instance
|
Variant
|
Returns the attribute which has been assigned to the given name |
RBXScriptSignal
|
Returns an event that fires when the given attribute changes |
Dictionary
|
Returns a dictionary of string → variant pairs for each of the |
Objects
|
Returns an array containing all of the |
string
[NotBrowsable]
|
Returns a coded string of the |
Array
[CustomLuaState]
|
Returns an array containing all of the descendants of the instance |
string
|
Returns a string describing the |
RBXScriptSignal
|
Get an event that fires when a given property of an object changes. |
bool
[CustomLuaState]
|
Returns true if an |
bool
|
Returns true if an |
bool
|
Returns true if an |
void
[Deprecated]
|
Sets the object’s Parent to nil, and does the same for all its descendants. |
void
|
Sets the attribute with the given name to the given value |
Instance
[CustomLuaState]
[CanYield]
|
Returns the child of the |
Objects
[Deprecated]
|
Returns an array of the object’s children. |
Instance
[Deprecated]
|
void
[Deprecated]
|
Instance
[Deprecated]
|
Objects
[Deprecated]
|
bool
[Deprecated]
[CustomLuaState]
|
bool
[Deprecated]
|
void
[Deprecated]
|
Events
RBXScriptSignal
|
Triggered when a player begins holding down the |
RBXScriptSignal
|
Triggers when the player ends holding down the button on a prompt with a non-zero |
RBXScriptSignal
|
Triggers when the |
RBXScriptSignal
|
Triggers when |
RBXScriptSignal
|
Triggered when the prompt |
RBXScriptSignal
|
Fires when the |
RBXScriptSignal
|
Fires whenever an attribute is changed on the |
RBXScriptSignal
|
Fired immediately after a property of an object changes. |
RBXScriptSignal
|
Fires when an object is parented to this |
RBXScriptSignal
|
Fires when a child is removed from this |
RBXScriptSignal
|
Fires when a descendant is added to the |
RBXScriptSignal
|
Fires immediately before a descendant of the |
RBXScriptSignal
[Deprecated]
|
Code Samples
Using a Proximity Prompt with a Seat
In the example below, a user must interact with a chair to sit in it. Paste this into a Script
that is a child of a ProximityPrompt
, which is itself a sibling of a Seat
object named Seat.
local proximityPrompt = script.Parent
local seat = proximityPrompt.Parent.Seat
seat:GetPropertyChangedSignal("Occupant"):Connect(function()
if seat.Occupant then
proximityPrompt.Enabled = false
else
proximityPrompt.Enabled = true
end
end)
proximityPrompt.Triggered:Connect(function(player)
seat:Sit(player.Character.Humanoid)
end)