用户:
老葵查看:8 回复:22 评论:8 创建时间:2020-05-17T10:23:35
我是老葵
又是一期代码教学
(以后每周日更)
代码其实很简单
首先,我们需要PVP代码
//一个简单的射击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() + 0, {//伤害取值0.2~20
attacker: entity,
});
});
});
以下月球大战代码基于上面的PVP代码编写
不可能的
![]()
这里写的
其实是作弊代码
基于上面的PVP代码编写
首先,是大部分外挂
world.onPlayerJoin(({entity})=>{
if(entity.player.name == '老葵'){//要改成你的名字,单引号里的
entity.player.walkAcceleration=1;//加速挂(走)
entity.player.walkSpeed=3;//加速挂
entity.player.swimAcceleration=1//加速挂(游泳)
entity.player.swimSpeed=3//加速挂
entity.player.flyAcceleration=1//加速挂(飞行)
entity.player.flySpeed=3//加速挂
entity.player.runAcceleration=2//加速挂(跑)
entity.player.runSpeed=4//加速挂
entity.player.canFly = true;//飞行
entity.player.invisible=true;//隐身
entity.player.A=100;//伤害
entity.player.enableDamage=false;//喵
}
})
然后,就是反血挂
world.onTakeDamage(({entity,attacker,hitEntity})=>{
if(entity.player.name == '老葵'){
attacker.player.hurt(hitEntity.hurt)
}
})
接着,是飞行+喵+穿墙挂,但反血会失效
world.onPlayerJoin(({entity})=>{
if(entity.player.name == '老葵'){
entity.player.spectator=true;
}
})
当然,代码里的“老葵”要改成自己的名字
就到这里白白啦~
其实是因为我不会
![]()
老葵代码补充(除非你要压榨平民,不然就加吧):
world.onPlayerJoin(({entity})=>{
if(entity.player.name !== '老葵'){//你的名字
entity.player.A=5
entity.enableDamage=true;
}
})
其实是一定要加
其
有白色字
点赞0
评论