猫史档案馆


求按左键就攻击的代码

用户:腾讯内部员工腾讯内部员工查看:7 回复:6 评论:7 创建时间:2020-04-19T15:14:06


        吧              


回复

上一页1 页 / 共 1下一页
三百克薄荷油三百克薄荷油

什么语言

点赞0


评论


腾讯内部员工腾讯内部员工

sj

 

点赞0


评论


鹅城县长鹅城县长

我超

点赞0


评论


腾讯内部员工腾讯内部员工

搞错了

 

 

点赞0


评论


腾讯内部员工腾讯内部员工

是js

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

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

点赞0


评论