
Lv.1
I will kill
签名:我要搞传说之下!!!
在 [求助]如何放置多个NPC 中回复
c喵tnpc=world.querySelector('#老人'); npc.enableInteract=true; npc.interactHint=npc.id; npc.interactRadius=16; //玩家与实体进行交互时触发 npc.onInteract(async({entity})=>{ c喵tresult=awaitentity.player.dialog({ type:Box3DialogType.SELECT, title:npc.id, lookTarget:npc, content:`${entity.player.name},你醒了,你好像是星羽族吧,你伤的很重,失去了飞行能力。孩子,你想喝些水吗?`, opti喵:['好的,谢谢','对不起,我想我应该走了','我是谁?我为什么会在这里?','你旁边的们是啥?'], }); //c喵ole.log(`选择了第index:${result.index}个选项:${result.value}`) //如果选了第一个选项,也就是'当然'。就会执行特定事件 if(result.index===0){ npc.say(`你看起来好多了`); } if(result.index===1){ npc.say(`好吧,出口就在后面,你走吧,保重!`); } if(result.index===2){ npc.say(`我是在星之漠找到你的,你需要去自己找到答案。孩子,去吧!去找喵属于你的东西!`); } if(result.index===3){ npc.say(`……通往地狱!!!千万别进去!不然……你将会万劫不复!!!`); } } });
2022-10-16T09:29:19 点赞:0
在 [求助]如何放置多个NPC 中回复
// 玩家与实体进行交互时触发 npc2.onInteract(async ({entity}) => { const result = await entity.player.dialog({ type: Box3DialogType.SELECT, title: npc2.id, lookTarget:npc2, content: `${entity.player.name},继续往前走,那里有你的_3u*je&和记忆=)`, options: ['你是谁!','不予理会','砍'], }); if (result.index === 0){ npc2.say(`哈……继续往前走……那里有你想要的答案……`); } if (result.index === 1){ npc2.say(`好吧,小子,我保证你会后悔……`); } if (result.index === 2){ npc2.say(`呵呵……你伤不到我的……你为何不继续向前走……找到答案呢……`); }
});
2022-10-16T20:25:51 点赞:0