Lv.1
双鱼座,脾气暴躁喜欢热闹有时候会很开心,喜爱编程,我还喜欢画画弹琴学习还有看书和练字
签名:开始上学了,我一般都会很少编程。如果你需要我的话,等我有时间的时候你就可以了。周末可以哟!(如果喜欢我的作品的话,记得点赞或者多浏览我。千万不要只看不点赞。)
在 编程猫是期真的更新了吗? 中回复
world.command=world.createEntity()
world.command.id='命令'
function runCmd(cmd){
w=cmd.split(' ')
if(w[0]=='/kill'){
finder=0
world.querySelectorAll('player').forEach((m)=>{if(m.player.name==w[1]){finder=m}})
if(!finder==0){finder.hurt(finder.hp,{attacker:world.command,});world.say(`玩家 ${w[1]} 已被击杀`)}
else{world.say(`ERROR:NO PLAYER NAMED ${w[1]}`)}
}else if(w[0]=='/hurt'){
finder=0
world.querySelectorAll('player').forEach((m)=>{if(m.player.name==w[1]){finder=m}})
try{
if(!finder==0){finder.hurt(parseInt(w[2]),{attacker:world.command,});world.say(`玩家 ${w[1]} 已被伤害`)}else{world.say(`ERROR:NO PLAYER NAMED ${w[1]}`)}}catch{world.say('ERROR:Fail')}
}else if(w[0]=='/hp'){
finder=0
world.querySelectorAll('player').forEach((m)=>{if(m.player.name==w[1]){finder=m}})
try{
if(!finder==0){finder.hp=parseInt(w[2]);world.say(`玩家 ${w[1]} 血量已设置`)}else{world.say(`ERROR:NO PLAYER NAMED ${w[1]}`)}}catch{world.say('ERROR:Fail')}
}else if(w[0]=='/tpto'){
finder3=0
world.querySelectorAll('*').forEach((m)=>{
if(m.isPlayer){ if(m.player.name==w[1]){finder3=m}}
else if(m.id==w[1]){finder3=m}
})
finder4=0
world.querySelectorAll('*').forEach((m)=>{
if(m.isPlayer){ if(m.player.name==w[2]){finder4=m}}
else if(m.id==w[2]){finder4=m}
})
if(!finder3==0){
try{finder3.position.set(finder4.position.x,finder4.position.y+5,finder4.position.z)
}catch{world.say('ERROR:Fail');return};
world.say(`玩家 ${w[1]} 已被传送`)
}
else{world.say(`ERROR:NO PLAYER NAMED ${w[1]}`)}
}else{
world.say(`ERROR:NO COMMAD CALLED "${w[0]}"`)
}
}
2020-05-13T19:20:03 点赞:0
在 为什么申请的权限这么久都没反应呢? 中回复
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();//强制重生,这里需要设好出生点,不然会从天上掉下来
})2020-05-20T20:34:15 点赞:0