Classe motore
Dialog
*Questo contenuto è tradotto usando AI (Beta) e potrebbe contenere errori. Per visualizzare questa pagina in inglese, clicca qui.
Sommario
Proprietà
Metodi
GetCurrentPlayers():Instances |
Eventi
DialogChoiceSelected(player: Instance,dialogChoice: Instance):RBXScriptSignal |
Riferimento API
Proprietà
BehaviorType
Campioni di codice
Tipo di Comportamento
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 = "Solo una persona può interagire con me alla volta."
singlePlayerDialog.Parent = singlePlayerPart
local multiplePlayersDialog = Instance.new("Dialog")
local multiplePlayersPart = Workspace.MultiplePlayersPart
multiplePlayersDialog.BehaviorType = Enum.DialogBehaviorType.MultiplePlayers
multiplePlayersDialog.InitialPrompt = "Qualsiasi numero di giocatori può interagire con me alla volta."
multiplePlayersDialog.Parent = multiplePlayersPartMetodi
GetCurrentPlayers
Dialog:GetCurrentPlayers():Instances
Restituzioni
Instances
Campioni di codice
Dialog:GetCurrentPlayers
local dialog = script.Parent
local function onChoiceSelected(_player, _choice)
local currentPlayers = dialog:GetCurrentPlayers()
print("I giocatori attuali nel dialogo:")
for _, player in ipairs(currentPlayers) do
print(player)
end
end
dialog.DialogChoiceSelected:Connect(onChoiceSelected)Eventi
DialogChoiceSelected