Reference API Roblox

Engine API

Website

Related

Reference API Roblox

Dialog

Creates NPC billboard-style dialog bubbles.

Member index 15

HistoryMember
731BehaviorType: DialogBehaviorType
731ConversationDistance: float
731GoodbyeChoiceActive: bool
486GoodbyeDialog: string
731InUse: bool
486InitialPrompt: string
731Purpose: DialogPurpose
731Tone: DialogTone
731TriggerDistance: float
731TriggerOffset: Vector3
648GetCurrentPlayers(): Instances
677SetGuiObject(gui: BillboardGui): null
573SetPlayerIsUsing(player: Instance, isUsing: bool): null
573SignalDialogChoiceSelected(player: Instance, dialogChoice: Instance): null
462DialogChoiceSelected(player: Instance, dialogChoice: Instance)
inherited from Instance
731Archivable: bool
731Capabilities: SecurityCapabilities
731IsInSandbox: bool
731Name: string
731Parent: Instance
731PredictionMode: PredictionMode
731Sandboxed: bool
731UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
707GetDescendants(): Instances
486GetFullName(): string
706GetStyled(name: string, selector: string?): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
698QueryDescendants(selector: string): Instances
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
731children(): Instances
731clone(): Instance
731destroy(): null
731findFirstChild(name: string, recursive: bool = false): Instance
731getChildren(): Instances
731isDescendantOf(ancestor: Instance): bool
731remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
731childAdded(child: Instance)
inherited from Object
731ClassName: string
731className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
731isA(className: string): bool
647Changed(property: string)

Description

The Dialog object allows users to create non-player characters (NPCs) that players can talk to using a list of choices. The Dialog object can be inserted into a part such as a Humanoid's head, and then a player will see a speech bubble above the part that they can click on to start a conversation. The creator of a place can choose what choices the player can say by inserting DialogChoice objects into the dialog.

History 68

Members 15

BehaviorType

TypeDefault
DialogBehaviorTypeSinglePlayer

The BehaviorType of a Dialog determines whether multiple players can interact with a dialog at once. The default value for this property is SinglePlayer.

SinglePlayer

When a Dialog is configured to SinglePlayer, only one player can interact with it at a time. As soon as a player engages with a dialog, other players will not be able to initiate the dialog until the first player is finished.

While a player is engaged with a dialog, the other players will see the dialog choices of the player who started the dialog, along with the responses.

MultiplePlayers

When a Dialog is set to MultiplePlayers, any player can initiate a dialog at any time, even if another player has already initiated the dialog. Unlike SinglePlayer however, Dialogs set to MultiplePlayers will not show the dialog choices and responses to anyone but the player in the conversation.

History 6

ConversationDistance

TypeDefault
float25

The maximum distance in studs between the player's character and the Dialog's parent BasePart at which the player can click on the speech bubble to begin or continue a conversation. If the player moves further than this distance from the parent part, they cannot initiate the dialog. The engine uses this value to select the nearest available Dialog when multiple are in range.

Default is 25.

History 6

DialogChoiceSelected

Parameters (2)
playerInstance
dialogChoiceInstance

Fired when a player chooses something to say, through a Dialog instance.

This event is client-side only and will not fire on the server. It should be connected to in either a LocalScript or a ModuleScript required by a LocalScript.

History 2

GetCurrentPlayers

Parameters (0)
No parameters.
Returns (1)
Instances

The GetCurrentPlayers function of a Dialog will return a list of Player currently using the Dialog. If there are no players using the dialog then the returned list will be empty.

History 3

GoodbyeChoiceActive

TypeDefault
booltrue

Toggles whether the goodbye option will be displayed. If true, the dialog will display the content of Dialog.GoodbyeDialog as the last option after other dialog choices. Clicking on the goodbye option will exit the dialog.

History 6

GoodbyeDialog

TypeDefault
string

The text displayed as the goodbye option at the bottom of the dialog choices list. When Dialog.GoodbyeChoiceActive is true, this string appears as the final selectable choice; clicking it ends the conversation. When Dialog.GoodbyeChoiceActive is false, this property has no visible effect.

Default is an empty string.

History 3

InUse

TypeDefault
boolfalse

A read-only runtime indicator that is true whenever at least one player is currently engaged in this dialog conversation. The engine sets this to true when a player begins talking and resets it to false when all participants leave. This property is not serialized and always starts as false when the place loads. Scripts can read this property but cannot set it directly.

Default is false.

History 6

  • 731 Change Default of InUse from to false
  • 726 Change Default of InUse from false to
  • 553 Change Default of InUse from to false
  • 486 Change ThreadSafety of InUse from ReadOnly to ReadSafe
  • 462 Change ThreadSafety of InUse from to ReadOnly
  • 47 Add InUse

InitialPrompt

TypeDefault
string

The text that the NPC displays inside the speech bubble when a player first begins the conversation. This is the opening line that appears before the player selects from DialogChoice options nested under this Dialog.

Default is an empty string.

History 3

Purpose

TypeDefault
DialogPurposeHelp

Controls which icon appears on the dialog's speech bubble indicator. Accepts a value from the DialogPurpose enum:

  • Quest -- displays an exclamation mark (!)
  • Help -- displays a question mark (?)
  • Shop -- displays a dollar sign ($)

Default is Help.

History 6

SetGuiObject

Parameters (1)
guiBillboardGui
Returns (1)
null

History 1

SetPlayerIsUsing

Parameters (2)
playerInstance
isUsingbool
Returns (1)
null

History 3

SignalDialogChoiceSelected

Parameters (2)
playerInstance
dialogChoiceInstance
Returns (1)
null

History 3

Tone

TypeDefault
DialogToneNeutral

Controls the color accent on the dialog's speech bubble. Accepts a value from the DialogTone enum:

  • Neutral -- blue accent bar
  • Friendly -- green accent bar
  • Enemy -- red accent bar

Default is Neutral.

History 6

TriggerDistance

TypeDefault
float0

The maximum distance in studs from the Dialog's parent BasePart at which the dialog's trigger indicator becomes visible to a player. When a player's character is within this distance, the speech bubble icon appears over the parent part, inviting interaction. The value is clamped between 0 and 400.

Default is 0, which effectively disables the distance-based trigger indicator; the player must be within Dialog.ConversationDistance to see and interact with the dialog.

History 6

TriggerOffset

TypeDefault
Vector30, 0, 0

A Vector3 offset in studs that shifts the position of the dialog's speech bubble indicator relative to the Dialog's parent BasePart. Use this to position the indicator above or beside the NPC rather than at the part's center. This property participates in model scaling.

Default is (0, 0, 0).

History 6

Settings