Reference API Roblox

Engine API

Website

Related

Reference API Roblox

Dialog

Creates NPC billboard-style dialog bubbles.

Member index 15

HistoryMember
726BehaviorType: DialogBehaviorType
726ConversationDistance: float
726GoodbyeChoiceActive: bool
486GoodbyeDialog: string
726InUse: bool
486InitialPrompt: string
726Purpose: DialogPurpose
726Tone: DialogTone
726TriggerDistance: float
726TriggerOffset: 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
726Archivable: bool
726Capabilities: SecurityCapabilities
726IsInSandbox: bool
726Name: string
726Parent: Instance
726PredictionMode: PredictionMode
726Sandboxed: bool
726UniqueId: 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
726children(): Instances
726clone(): Instance
726destroy(): null
726findFirstChild(name: string, recursive: bool = false): Instance
726getChildren(): Instances
726isDescendantOf(ancestor: Instance): bool
726remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
726childAdded(child: Instance)
inherited from Object
726ClassName: string
726className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
726isA(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 60

Members 15

BehaviorType

TypeDefault
DialogBehaviorType

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.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
local Workspace = game:GetService("Workspace")

local singlePlayerDialog = Instance.new("Dialog")
local singlePlayerPart = Workspace.SinglePlayerPart
singlePlayerDialog.BehaviorType = Enum.DialogBehaviorType.SinglePlayer
singlePlayerDialog.InitialPrompt = "Only one person can interact with me at once."
singlePlayerDialog.Parent = singlePlayerPart

local multiplePlayersDialog = Instance.new("Dialog")
local multiplePlayersPart = Workspace.MultiplePlayersPart
multiplePlayersDialog.BehaviorType = Enum.DialogBehaviorType.MultiplePlayers
multiplePlayersDialog.InitialPrompt = "Any number of players can interact with me at once."
multiplePlayersDialog.Parent = multiplePlayersPart

History 5

ConversationDistance

TypeDefault
float

The furthest distance that a player can be from the Dialog's parent to start a conversation.

History 5

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
bool

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 5

GoodbyeDialog

TypeDefault
string

Sets the sentence that the dialog will show to the player when the chat ends

History 3

InUse

TypeDefault
bool

If true, this dialog is being used by at least one player.

History 5

  • 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

Sets the first sentence that the dialog will show to the player, once a chat is commenced.

History 3

Purpose

TypeDefault
DialogPurpose

Sets the icon that the initial dialog displays.

History 5

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
DialogTone

Sets the color of the NPC's speech bubble.

History 5

TriggerDistance

TypeDefault
float

Sets the maximum distance that a dialog can be triggered from.

History 5

TriggerOffset

TypeDefault
Vector3

Sets the offset of the dialog relative to the dialog's parent.

History 5

Settings