用户:
SHEL深空无尽查看:5 回复:8 评论:5 创建时间:2021-04-11T15:36:10
求代码急需:蜜码机的代码怎么写?(跪下)
![]()
1086爱编程const w = world.querySelector('#密码门');
w.enableInteract = true; // 允许进行互动
w.interactRadius = 2; // 实体的互动范围
w.interactHint = w.id;; // 互动提示框显示实体的名称
w.interactColor = new Box3RGBColor(1,0,1); // 互动提示的文字颜色
// 玩家与实体进行交互时触发
w.onInteract(async({entity}) => {
const result = await entity.player.dialog({
type: Box3DialogType.INPUT,
title: "密码门",
titleTextColor: new Box3RGBAColor(1, 1, 1, 1),
titleBackgroundColor: new Box3RGBAColor(0, 0, 0, 0.98),
content: `${entity.player.name},你知道进入密码门的暗号吗?`,
confirmText: '确定', // 确定按钮上面的文字。按下确定按钮后,提交回答。
placeholder: '……', // 输入框背景上的提示文字。
contentTextColor: new Box3RGBAColor(1, 1, 1, 1),
contentBackgroundColor: new Box3RGBAColor(0, 0, 0, 0.98),
lookEye: entity.position.a喵(entity.player.facingDirection.scale(5)),
lookTarget: entity,
});
const surprise = ['密码','密码' ]
if(surprise.includes(result)){
entity.position.set(119,9,100)//坐标
}
});点赞0
评论