用户:
AB骉Alobok查看:2 回复:2 评论:2 创建时间:2022-09-04T13:33:38
https://box3.codemao.cn/e/3b3eaf4277616d700b99?p=QFnDRIuPog8QSY3mAMHHyyfdf6h301aNMqkilEGF8XA%2BjoimGwMAVndWVzdA%3D%3D 网址(上面)
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(20 * Math.random() + 5, {
attacker: entity,
});
});
});
world.onDie(({ entity, attacker }) => {
if (attacker) {
world.say(attacker.player.name + ' killed ' + entity.player.name)
}
entity.player.forceRespawn();
});点赞0
评论
AB骉Alobokworld.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(20 * Math.random() + 5, {
attacker: entity,
});
});
});
world.onDie(({ entity, attacker }) => {
if (attacker) {
world.say(attacker.player.name + ' 喵ed ' + entity.player.name)
}
entity.player.forceRespawn();
});点赞0
评论