Say I want to make a brick dissapear when a certain dialog choice is selected.
I make an NPC, then I add a dialog tree. It is now set so when a player talks to the NPC, they have the choice to say "Can you make that brick dissapear?". The NPC replies 开发者_如何转开发"There you go!"
What would I need to do to make it so when the NPC replies, the brick dissapears?
On roblox?
There's an event in the Dialog object.
DialogChoiceSelected(Instance player, Instance dialogChoice)
This is how you can use it for making a brick "disappear" as long as you have defined the variables "Dialog" and "Brick"
Dialog.DialogChoiceSelected:connect(function(Player, Choice)
if Choice.Name == "BrickChanger" then
Brick.Transparency = 1
end
end)
The argument "Player" is the player who selected that choice, the "Choice" argument refers to the DialogChoice userdata that was chosen.
精彩评论