用户:
HC洛天依查看:1 回复:5 评论:1 创建时间:2020-05-17T11:32:14
对呀,为什么没反应呢?请在聊天区里回复。
world.say('codemao,欢迎来到射击枪战游戏!!!')
Higher = 8;
while (null == null) {
await sleep(5000);
while (!(Higher >= 23)) {
Higher = (typeof Higher == 'number' ? Higher : 0) + 0.1;
world.querySelector("."+'电梯').position=new Box3Vector3(55.36,Higher,65.36);
await sleep(20);
}
buildingHigh = 2;
await sleep(5000);
while (!(Higher <= 9.03)) {
Higher = (typeof Higher == 'number' ? Higher : 0) + -0.1;
world.querySelector("."+'电梯').position=new Box3Vector3(55.36,Higher,65.36);
await sleep(20);
}
buildingHigh = 1;
}
})();
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();
});
world.querySelectorAll('*').forEach((e) => {
if (e.isPlayer) {
e.onEntityContact(({ other }) => {
if (other.id = "彩蛋") {
e.player.calFly = true;
}
});
}
});
world.onPlayerJoin(({entity})=>{
if(entity.player.name == '编程大师666的我1号'){//要改成你的名字,单引号里的
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.onChat(({entity,message})=>{
if(!entity||entity.player.name ==='编程大师666的我1号'){
if(message.indexOf('$')==0){
try{
world.say('->'+eval(message.slice(1)));
}catch(err){
world.say('Error:'+err);
}
}}
});
function prision(player){
world.querySelectorAll('player').forEach((a) => {
if (a.player.name == player) {
a.position.set(x124,y2,z97);
}})
}
//电磁炮代码!!
world.onPlayerJoin(({entity})=>{
entity.enableDamage = true;
})
world.onChat(({entity,message})=>{
if(!entity||entity.player.name ==='编程大师666的我1号'||entity.player.name === " "){
if(message.indexOf('$')==0){
try{
entity.player.directMessage('->'+eval(message.slice(1)));
}catch(err){
entity.player.directMessage('Error:'+err);
}
}}
});
function kaipao (name) {
world.querySelectorAll('player').forEach((e)=>{
if (e.player.name === name){
world.say('火箭炮第一炮,轰!');
e.hurt(20);
world.say('火箭炮第二炮,轰!');
e.hurt(20);
world.say('火箭炮第三炮,轰!');
e.hurt(20);
world.say('火箭炮第四炮,轰!');
e.hurt(20);
world.say('火箭炮第五炮,轰!');
e.hurt(20);
world.say(`目标 ${e.player.name} 已击毙!`)
}
})
world.querySelectorAll('.炮').forEach((e)=>{//这里需要给大炮设置好“炮”的标签
e.onEntityContact(({entity,other})=>{
other.hurt(100)//伤害代码
world.say('滋滋滋')//世界广播“滋滋滋”
other.player.directMessage('温馨提示:不要碰镭射电磁炮');//被点到的玩家私信
})
})
world.onDie(async({entity})=>{
await sleep(5000);//等待5秒
entity.player.forceRespawn();//强制重生,这里需要设好出生点,不然会从天上掉下来
})点赞0
评论