猫史档案馆


完整喵战代码,要的拿去

用户:BSS梅者如西BSS梅者如西查看:10 回复:2 评论:10 创建时间:2020-05-04T16:48:58


world.onPlayerJoin(({ entity }) => {
    entity.enableDamage = true;
    entity.player.onPress(({ button, raycast:{ hitEntity, direction } }) => {
        if (button !== 'action0' || !hitEntity) {
            return;
        }
        hitEntity.velocity.x += direction.x;
        hitEntity.velocity.y += 0.5;
        hitEntity.velocity.z += direction.z;
        if(!hitEntity.isPlayer){return}
        hitEntity.hurt(5 * Math.random() + 5, {
            attacker: entity,
        });
    });
});
//检测攻击代码
world.onDie(({ entity, attacker }) => {
    if (attacker) {
        world.say(attacker.player.name + ' 击杀了 ' + entity.player.name)
    }
    entity.player.forceRespawn();
});//喵亡后代码


回复

上一页1 页 / 共 1下一页
凌_墨水凌_墨水

Gitbook里头有啊

点赞0


评论


温和的大黄鸡温和的大黄鸡

能出一个组队的吗?

点赞0


评论