用户:
build_一只建筑师吖查看:5 回复:14 评论:5 创建时间:2020-07-03T21:34:15
world.onPlayerJoin(({ entity }) => {
entity.enableDamage = true;
entity.player.onPress(({ button, raycast: { hitEntity, direction } }) => {
if (button !== 'action0' || !hitEntity) {
return;
}
world.say('砰!!!')
hitEntity.hurt(playerhurt), {
attacker: entity,
};
});
});
x = 10;
if (x == 0) {
entity.player.directMessage('你喵了太多次,不能复活了');
}
world.onDie(async ({entity,attacker})=>{
x = (typeof x == 'number' ? x : 0) + -1;
entity.player.color=new Box3RGBColor(1000,0,0);
entity.player.directMessage('你喵了,10秒后复活');
world.say(String(entity.player.name) + ' out! ');
for (var count = 0; count < 10; count++) {
await sleep(1000);
}
entity.hp=100;
entity.player.color=new Box3RGBColor(0,1000,1000);
entity.player.directMessage('复活成功,快去报仇吧!');
})
var playerhp, playerhurt;
(async ({entity})=>{
if (entity.player.name == 'build_乐观的暴风雀wGfG') {
playerhp = 1000;
playerhurt = 100; }
else {
playerhp = 100;
playerhurt = 5; }
entity.hp=playerhp;
entity.hurt=playerhurt;
});
希望的效果:
PVP代码
点击玩家伤害
如果
用户名
等于
build_乐观的暴风雀wGfG
设置血量为1000
攻击力为100
求了~
墨水
shyfcka
观澜
帮忙看看
Chengxuyee_已退hurt写错了)
x不是玩家的私有变量()
entity.player.name本来就是字符串()
根据用户改血量的代码应该放在玩家进入事件里)
顺带一提)你叫观澜观澜估计也不会)
点赞0
评论