猫史档案馆


求Box3地图和pvp代码

用户:MC呆萌大明MC呆萌大明查看:3 回复:6 评论:3 创建时间:2020-04-13T15:11:18


急需一个Box3地图和pvp代码


回复

上一页1 页 / 共 1下一页
一笑置之_一笑置之_

//一个简单的射击PvP
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(2 * Math.random() + 1, {
attacker: entity,
});
});
});

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

点赞0


评论


一笑置之_一笑置之_

只有代码,没有权限

点赞0


评论


一笑置之_一笑置之_

我是一笑

点赞0


评论


亿只懒Ink亿只懒Ink

嘿嘿,我正好要招人,就招你吧,链接4月15号发

点赞0


评论


_F_S_2__F_S_2_

来我们吧

点赞0


评论


明星喵明星喵

//一个简单的射击PvP
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(2 * Math.random() + 1, {
attacker: entity,
});
});
});

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

点赞0


评论