猫史档案馆


一个远距离射击代码

用户:杏花无处微雨杏花无处微雨查看:0 回复:2 评论:0 创建时间:2022-04-14T19:06:44


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.3;         hitEntity.velocity.z += direction.z;         hitEntity.hurt(10 * Math.random() + 10, {             attacker: entity,         });     }); });

 

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


回复

上一页1 页 / 共 1下一页
Robot一只屑代码师Robot一只屑代码师

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.3;         hitEntity.velocity.z += direction.z;         hitEntity.hurt(10 * Math.random() + 10, {             attacker: entity,         });     }); });

 

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

点赞0


评论


egg鸡蛋蛋egg鸡蛋蛋

/你这击退很迷啊/

点赞0


评论