猫史档案馆


【代码帮助】各位岛民如何存档啊!

用户:YLG_個YLG_個查看:3 回复:1 评论:3 创建时间:2020-09-12T22:43:00


一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一一各位岛民如何存档吖emotion_编程猫_紧张求帮忙emotion_委屈


回复

上一页1 页 / 共 1下一页
一勺小汤_纪念号一勺小汤_纪念号

挖坟

 
//存档点代码
const checkPoint = {};
world.querySelectorAll('.存档点').forEach((e)=>e.onEntityContact(({entity, other}) => {

    if (other.isPlayer) {
        checkPoint[other.player.name] = entity.position;
        other.player.directMessage("存档成功!");
    }
}));

//传送点代码
world.querySelectorAll('.还原点').forEach((e) => e.onEntityContact(({entity, other}) => {

        if (other.isPlayer && other.player.name in checkPoint) {
        other.position.copy(checkPoint[other.player.name]);
        other.position.y += 5;
        }
        
}));

点赞0


评论