요약
속성
메서드
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