猫史档案馆


【BOX3】!左键攻击代码 !&& !招代码师啦 !&&!帮人当代码师 !

用户:血月孤狼血月孤狼查看:13 回复:2 评论:13 创建时间:2022-01-29T21:20:49


<iframesrc="输入你的网址"></iframe> 大家有时间组队玩一下我的游戏吧 下面是正题↓ 还有 你们知道吗? 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; hitEntity.hurt(7*Math.random()+5,{ attacker:entity, }); }); }); world.onDie(({entity,attacker})=>{ if(attacker){ world.say(attacker.player.name+'killed'+entity.player.name) } entity.player.forceRespawn(); });  针对萌新: 这代码可以实现左键攻击 针对老手: 这代码如果有错误 评论! 好了 下一个 本人急招代码师! 会实体的速到 https://box3.codemao.cn/e/d770096cc9898ca682e6?p=oNBXkHd9Bk%2B7QgSR7yIDWikgz%2ByzHs8O8s4imcqB78A6qtiVnqLwnku6PnoIHluIg%3D 谢谢! 有要我当代码师的吗? 评论里发链接! 给个赞吧!          


回复

上一页1 页 / 共 1下一页
BCM墨水瓶BCM墨水瓶

沙发

 

点赞0


评论


血月孤狼血月孤狼

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;
        hitEntity.hurt(7 * Math.random() + 5, {
            attacker: entity,
        });
    });
});

world.onDie(({ entity, attacker }) => {
    if (attacker) {
        world.say(attacker.player.name + ' killed ' + entity.player.name)
    }
    entity.player.forceRespawn();
});

点赞0


评论