エンジンクラス
Dialog
*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。
概要
プロパティ
方法
GetCurrentPlayers():Instances |
イベント
DialogChoiceSelected(player: Instance,dialogChoice: Instance):RBXScriptSignal |
APIリファレンス
プロパティ
BehaviorType
コードサンプル
動作タイプ
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 = "一度に一人だけが私と対話できます。"
singlePlayerDialog.Parent = singlePlayerPart
local multiplePlayersDialog = Instance.new("Dialog")
local multiplePlayersPart = Workspace.MultiplePlayersPart
multiplePlayersDialog.BehaviorType = Enum.DialogBehaviorType.MultiplePlayers
multiplePlayersDialog.InitialPrompt = "任意の数のプレイヤーが一度に私と対話できます。"
multiplePlayersDialog.Parent = multiplePlayersPart方法
GetCurrentPlayers
Dialog:GetCurrentPlayers():Instances
戻り値
Instances
コードサンプル
Dialog:GetCurrentPlayers
local dialog = script.Parent
local function onChoiceSelected(_player, _choice)
local currentPlayers = dialog:GetCurrentPlayers()
print("ダイアログ内の現在のプレイヤー:")
for _, player in ipairs(currentPlayers) do
print(player)
end
end
dialog.DialogChoiceSelected:Connect(onChoiceSelected)イベント
DialogChoiceSelected