猫史档案馆


【代码教程】通过模型让玩家说话~()

用户:ComsComs查看:5 回复:8 评论:5 创建时间:2023-05-02T17:27:23


 

 

 

啊哈哈()

 

水贴时间!!!()

 

首先先在地图放个模型~()

 

center_image

然后)就上代码啦~emotion_doge

 

ohhhh

var npc = world.querySelector('#可爱的羽毛棒棒哒~');// 模型id啦~~~
npc.enableInteract = true;// 允许互动啦~
npc.interactHint = npc.id;// ohh这个你懂的(确信)
npc.interactRadius = 2;
npc.onInteract(async ({entity}) => {
    const result = await entity.player.dialog({// 弹出对话框啦~
        contentTextColor: [0, 1, 0, 1],// 颜色
        contentBackgroundColor: [0, 0, 0, 1],// 颜色
        titleTextColor: [0, 1, 0, 1],// 这些是颜色~我懒得写啦~()(懒癌)
        titleBackgroundColor: [0, 0, 0, 1],// 颜色
        type: Box3DialogType.SELECT,// ohh对话框形式~()这里是选择框~~~()
        title: npc.id,// 题目是模型滴id鸭()~
        lookTarget:npc,// 说话时看着模型~
        options: ['我要说话!'],// 按钮内容~
    });
    if (result.index === 0){
        const result114514 = await entity.player.dialog({    // ohh
            contentTextColor: [0, 1, 0, 1],
            contentBackgroundColor: [0, 0, 0, 1],
            titleTextColor: [0, 1, 0, 1],// 颜色啦~
            titleBackgroundColor: [0, 0, 0, 1],     
            type: Box3DialogType.INPUT,// 这个是创建阿巴阿巴框()你懂的()
            title: '羽毛',// 题目啦~
            confirmText : 'turn✔'
        });
        if (result114514){
            world.say(`${entity.player.name}:${result114514}`)// 内容aa~
            entity.player.dialog({// 弹出对话框~()
                contentTextColor: [0, 1, 0, 1],
                contentBackgroundColor: [0, 0, 0, 1],
                titleTextColor: [0, 1, 0, 1],// 颜色~拉
                titleBackgroundColor: [0, 0, 0, 1],
                hasArrow: true,
                type:Box3DialogType.TEXT,
                title:'羽毛',
                content:(`你的消息:${result114514}\n成功world.say!`),
            })
        } 
    }
});


回复

上一页1 页 / 共 1下一页
Dr0pp3rDr0pp3r

各位蟀哥,霉女,富佬,翔擒们,https://shequ.codemao.cn/work/185331175是石炭Carbonium工作室推出的FPS练习游戏,由多名创作者联合制作,灵感来源于Steam著名练习游戏《Aimlab》(如果您认为该宣传影响到了您,可以删除并在作品下方反馈,我们将不断改进)

点赞0


评论


box3的果敢的超能鸭viwXbox3的果敢的超能鸭viwX

yeeeeeeeeee

点赞1


评论


ComsComs

ddd

点赞0


评论


WitheredWonderWitheredWonder

lsaac是女哒()()

点赞0


评论


追梦ez追梦ez

选成py格逝了罢(悲)

点赞0


评论


ComsComs

ddd()

点赞0


评论


ComsComs

yeeeeeeeeee

点赞0


评论


NysidlaNysidla

模型:油饼食不食,你禁言了管我毛蛋逝,再说插件也能让你say graceful chinese

点赞0


评论