猫史档案馆


【教程】密码锁

用户:ComsComs查看:5 回复:7 评论:5 创建时间:2023-02-25T23:27:53


  world.querySelectorAll('*').forEach(async (e)=>{     if (e.id == '模型名字'){         e.enableInteract = true;         e.interactRadius = 2;// 互动距离         e.interactHint = 'id';         e.onInteract(async ({ entity }) =>{             const password = await entity.player.dialog({                 type : Box3DialogType.INPUT,                 content : '阿巴阿巴',    // 内容                 title : '阿巴巴巴',    // 题目                 confirmText : '确定',    // 输入框提示文本                 placeholder : '阿巴阿巴阿巴',    // 按钮文本             })             if (!password || password === null) return;

 

            if (String(password) == '114514'){// 填密码                 entity.player.directMessage('啊对对对');                                               entity.position.set(0, 0, 0)// 答对后传送到哪里(坐标             } else {

 

                entity.player.directMessage('啊错错错')             }         })     }; })         下期写恒光学院的椅子代码~)  


回复

上一页1 页 / 共 1下一页
ComsComs

c吞我格式

点赞0


评论


仙之鹤仙之鹤

9)

点赞0


评论


USS繁星USS繁星

world.querySelectorAll('*').forEach(async (e)=>{   

  if (e.id == '模型名字'){         

e.enableInteract = true;        

 e.interactRadius = 2;// 互动距离         

e.interactHint = 'id';         

e.onInteract(async ({ entity }) =>{             

const password = await entity.player.dialog({                

 type : Box3DialogType.INPUT,               

  content : '阿巴阿巴',    // 内容                

 title : '阿巴巴巴',    // 题目                 

confirmText : '确定',    // 输入框提示文本                 

placeholder : '阿巴阿巴阿巴',    // 按钮文本            

 })            

 if (!password || password === null) return;



            if (String(password) == '114514'){// 填密码                

 entity.player.directMessage('啊对对对');                                              

 entity.position.set(0, 0, 0)// 答对后传送到哪里(坐标         

    } else {



                entity.player.directMessage('啊错错错')     

        }        

 })     

};

})         //下期写恒光学院的椅子代码~)  

点赞0


评论


ComsComs

纠正)

world.querySelectorAll('*').forEach(async (e)=>{// 扫遍所有模型
    if (e.id == '阿巴阿巴'){// 模型id名字
        e.enableInteract = true;
        e.interactRadius = 2;
        e.interactHint = '阿巴阿巴';// 题目
        e.onInteract(async ({ entity }) =>{
            const password = await entity.player.dialog({
                type : Box3DialogType.INPUT,// 对话框形式
                content : '请输入暗号~',    // 内容
                title : '阿巴巴巴阿巴',    // 题目
                confirmText : '确定',    // 输入框提示文本
                placeholder : '6',    // 按钮文本
            })
            if (!password || password === null) return;// 按叉不会报错)

            if (String(password) == '114514'){// 填密码
                entity.player.directMessage('啊对对对');
                entity.position.set(26, 46, 10)// 答对之后position.set哪里
            } else {
                entity.player.directMessage('啊错错错')// 给玩家私发消息
            }
        })
    };
})

 

点赞0


评论


ComsComs

ddd

点赞0


评论


屑怪盗屑怪盗

喵d

点赞0


评论


神奇代码岛func王清林神奇代码岛func王清林

N p

点赞0


评论