Engine Class
Dialog
Summary
Properties
Methods
GetCurrentPlayers():Instances |
Events
DialogChoiceSelected(player: Instance,dialogChoice: Instance):RBXScriptSignal |
API Reference
Properties
BehaviorType
Code Samples
Behavior Type
local Workspace = game:GetService("Workspace")
local singlePlayerPartSetup = Instance.new("Part")
singlePlayerPartSetup.Name = "SinglePlayerPart"
singlePlayerPartSetup.Parent = Workspace
local multiplePlayersPartSetup = Instance.new("Part")
multiplePlayersPartSetup.Name = "MultiplePlayersPart"
multiplePlayersPartSetup.Parent = 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 = multiplePlayersPartMethods
GetCurrentPlayers
Dialog:GetCurrentPlayers():Instances
Returns
Instances
Code Samples
Dialog:GetCurrentPlayers
local dialog = script.Parent
local function onChoiceSelected(_player, _choice)
local currentPlayers = dialog:GetCurrentPlayers()
print("The current players in the dialog:")
for _, player in ipairs(currentPlayers) do
print(player)
end
end
dialog.DialogChoiceSelected:Connect(onChoiceSelected)Events
DialogChoiceSelected