当出现特定对话框时,如何在 ROBLOX 中创建事件?
假设我想让一块砖块在选择某个对话框选项时消失。
我创建了一个 NPC,然后添加了一个对话树。现在的设置是,当玩家与 NPC 交谈时,他们可以选择说“你能让那块砖块消失吗?”。 NPC 回答:“给你!”
我需要做什么才能让 NPC 回复时砖块消失?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在罗布洛克斯上?
Dialog 对象中有一个事件。
DialogChoiceSelected(Instanceplayer, InstancedialogChoice)
只要您定义了变量“Dialog”和“Brick”,您就可以使用它来使砖块“消失”。
参数“Player”是选择该选项的玩家,“Choice”参数指的是所选的 DialogChoice 用户数据。
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"
The argument "Player" is the player who selected that choice, the "Choice" argument refers to the DialogChoice userdata that was chosen.