用户:
无尽之海查看:0 回复:0 评论:0 创建时间:2023-10-19T23:15:18
var awa = 0; world.querySelectorAll('*').forEach(async (e)=>{// 扫遍所有模型
if (e.id == '密码按钮'){// 模型id名字
e.enableInteract = true;
e.interactRadius = 1.5;
e.interactHint = '题目';// 题目
e.onInteract(async ({ entity }) =>{
const password = await entity.player.dialog({
type : GameDialogType.INPUT,// 对话框形式
content : '请输入密码', // 内容
title : '密码锁', // 题目
confirmText : '请输入密码', // 输入框提示文本
placeholder : '确认', // 提示文本
})
if (!password || password === null) return;// 按叉不会报错)
if (String(password) == '1') {// 填密码
entity.player.directMessage('密码正确,可进入');
world.querySelectorAll('.习武门').forEach(async(awa_1)=>{
await sleep(150)
awa_1.position.z -= 0.3
await sleep(150)
awa_1.position.z -= 0.3
await sleep(150)
awa_1.position.z -= 0.3
await sleep(150)
awa_1.position.z -= 0.3
await sleep(150)
awa_1.position.z -= 0.3
await sleep(150)
awa_1.position.z -= 0.3
await sleep(50)
awa_1.position.z += 0.3
await sleep(150)
awa_1.position.z += 0.3
await sleep(150)
awa_1.position.z += 0.3
await sleep(150)
awa_1.position.z += 0.3
await sleep(150)
awa_1.position.z += 0.3
await sleep(150)
awa_1.position.z += 0.3
})
}
else {
entity.player.directMessage('密码错误,请重试!')// 给玩家私发消息
}
})
}
})
这段是由幻影游船制作,因为它的程序总是不分段,所以特别优化。