猫史档案馆


【岛三】电脑监控教程

用户:DebugDynamoDebugDynamo查看:0 回复:6 评论:0 创建时间:2022-01-15T08:23:41


所用代码如下:

function find(name) {
    a = world.querySelectorAll('player');
    for (let i in a) {
        if (a[i].player.name == name) return a[i];
    }
}
async function allPlayers() {
    return world.querySelectorAll('player')
}

world.querySelectorAll('.电脑').forEach((e)=>{
    e.enableInteract = true
    e.interactHint = '电脑'
    e.interactRadius = 3
    e.onInteract(async({entity})=>{
        var playername = []
        for(const e of allPlayers()){
            playername.push(e.player.name)
        }
        const a = await entity.player.dialog({
            type:Box3DialogType.SELECT,
            options:playername
        })
        if(!a || a == null){
            return
        }
        entity.player.cameraEntity = find(a.value)
        const as = await entity.player.dialog({
            type:Box3DialogType.SELECT,
            options:['返回']
        })
        if(!as || as == null){
            entity.player.cameraEntity = entity
            return
        }
        entity.player.cameraEntity = entity
    })
})

不喜勿喷

排版不要没!


回复

上一页1 页 / 共 1下一页
DebugDynamoDebugDynamo

沙发沙发

点赞0


评论


DebugDynamoDebugDynamo

视频链接:https://www.bilibil喵video/BV1SL4y1b7Z5?spm_id_from=333.999.0.0

点赞1


评论


DebugDynamoDebugDynamo

顶!!!!

点赞0


评论


DebugDynamoDebugDynamo

顶   

点赞0


评论


DebugDynamoDebugDynamo

顶 

点赞0


评论


Ezra__Ezra__

怎么可以这么眼熟👀

点赞0


评论