猫史档案馆


管喵系统!超详细注释

用户:治愈绾兮治愈绾兮查看:21 回复:14 评论:21 创建时间:2020-09-26T15:50:13


world.querySelectorAll(".作者专用").forEach((finder) => {//新建一个叫作者专用的实体,(放在一个隐蔽的地方)


    finder.enableInteract = true; 
    finder.interactRadius = 8;  
    finder.interactHint = "作者专用";
    finder.interactColor = new Box3RGBColor(1, 1, 1); 
    finder.onInteract(async ({ entity }) => {
        const result = await entity.player.dialog({
            title: '系统',
            type: Box3DialogType.INPUT, 
            content: `你要关哪个玩家?`,
            titleBackgroundColor: new Box3RGBAColor(0.968, 0.702, 0.392, 1),
            placeholder: '请输入玩家名', //输入玩家名
            confirmText: '确认',
        })
        const findee = world.querySelector("." + result);

        const resu=await entity.player.dialog({
            title: '系统',
            type: Box3DialogType.SELECT,
            content: `找到玩家${findee.player.name}`,
            titleBackgroundColor: new Box3RGBAColor(0.968, 0.702, 0.392, 1),
            lookEye: entity,
            lookEyeOffset: new Box3Vector3(0, 30, 0),
            lookTarget: findee,
            options:["确认"],
        })

                if(resu.index==0){
            entity.position.set(findee.position.x,findee.position.y+2,findee.position.z)
        }
        entity.position.set(12,5,116)//监狱的位置
        findee.player.dialog({
            title: '系统',
            type: Box3DialogType.TEXT,
            content: `你被管喵关进了监狱`,
            titleBackgroundColor: new Box3RGBAColor(0.968, 0.702, 0.392, 1),
        })
    })
})
        
world.onChat(({ entity, message }) => {
    if (message === '作者,我错了') {//对方输入后回到出生点
        entity.position.set(122,15,122)//出生点位置
    } else if (message === 'shrink') {
        entity.player.spawnPoint.set(122,15,122)
    }
})

最后,打个广告center_image

顺便求个赞,谢谢!


回复

上一页1 页 / 共 1下一页
指令者指令者

沙发emotion_编程猫_点赞

点赞0


评论


J_K_Hermione_build白泽J_K_Hermione_build白泽

赞!

点赞0


评论


GZ006GZ006

emotion_编程猫_点赞

点赞0


评论


青柠檬_肉乎乎的兔子青柠檬_肉乎乎的兔子

哇哦

点赞0


评论


高贵的木叶龙A35d高贵的木叶龙A35d

感觉有点错误啊,玩家没有标签,查找玩家只能用player吧

点赞0


评论


土拨鼠土拨鼠

不行啊

点赞0


评论


治愈绾兮治愈绾兮

center_imagecenter_imagecenter_imagecenter_imagecenter_image

点赞0


评论


TLOCKTLOCK

怎么不行,报错

点赞0


评论


ZHOU_FanJinZHOU_FanJin

emotion_编程猫_点赞

点赞0


评论


@技术狗@技术狗

咋开启

点赞0


评论


J_K_Hermione_build白泽J_K_Hermione_build白泽

emotion_编程猫_点赞

点赞0


评论


高贵的木叶龙A35d高贵的木叶龙A35d

报错的话应该是这个原因:模型名称和文件里面vb名称都要改成作者专用……

点赞1


评论


小小爱html小小爱html

TypeError: Cannot read property 'player' of null

  at eval  ( index.js:77:36 )   at send  ( /usr/src/app/build/start.js:178751:53 )

点赞0


评论


无尽深空无尽深空

当我使用这个时,搞别人的名字,自己倒是去监狱了。

点赞0


评论