猫史档案馆


我搜刮来的代码

用户:Chara_juechuief_sChara_juechuief_s查看:6 回复:7 评论:6 创建时间:2020-04-25T16:59:12


world.onChat(({message,entity})=>{
    if(message==='幽灵模式'){
       entity.player.spectator=true;
       world.say(entity.player.name+'开启了幽灵')
    }
});//幽灵模式

 

world.querySelectorAll('.终点').forEach((e)=>{
     e.onEntityContact(({entity,other}) => {
         other.player.canFly = true;
         world.say(other.player.name + '到达了终点,奖励飞行权限!')
     })
})//终点代码
world.querySelectorAll('.实体标签').forEach((e)=>{
    e.onEntityContact(({entity,other})=>{ 
        if(!other.isPlayer){return}
        other.mesh=entity.mesh;
        other.meshScale=entity.meshScale;
        other.player.invisible=true;   
        other.meshOrientation = new Box3Quaternion(0, 1, 0, 0);
        world.say(other.player.name+" 变成了什么什么");
        other.player.runSpeed = 2;
    });
});
world.sunPhase = 0;
world.sunFrequency = 1/24/60/60;

var m;

world.onPlayerJoin(({ entity }) => {
    if(entity.player.name == '你的名字' || entity.player.name == '你的合作人的的名字' || entity.player.name == '你的合作人的的名字' || entity.player.name == '你的合作人的的名字' || entity.player.name == '你的合作人的的名字' || entity.player.name == '你的合作人的的名字' || entity.player.name == '你的合作人的的名字' || entity.player.name == '你的合作人的的名字'){
        entity.player.canFly = true;
        entity.player.emissive = 0.01;
    }
    
    entity.enableDamage = true;
    entity.player.onPress(({ button, raycast:{ hitEntity, direction } }) => {
        if (button !== 'action0' || !hitEntity) {
            return;
        }
        hitEntity.velocity.x += direction.x;
        hitEntity.velocity.y += 0.1;
        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.onChat(({ entity, message }) => {
    if ( entity && entity.isPlayer ) {
        if( entity.player.name == '你的名字' ){
            m = message;
        }
        
        if(message == m){
            if (entity.player.invisible == false){
                entity.player.invisible = true;
            }else {
                entity.player.invisible = false;
            }
        }

        if(entity.player.name == '你的名字' || entity.player.name == '你的合作人的的名字' || entity.player.name == '你的合作人的的名字' || entity.player.name == '你的合作人的的名字' || entity.player.name == '你的合作人的的名字' || entity.player.name == '你的合作人的的名字' || entity.player.name == '你的合作人的的名字' || entity.player.name == '你的合作人的的名字'){
            if(message == '大'){
                entity.player.scale *= 6;
                entity.player.walkSpeed *= 6;
                entity.player.runSpeed *= 6;
                entity.player.crouchSpeed *= 6;
            }
        
            if(message == '小'){
                entity.player.scale /= 6;
                entity.player.walkSpeed /= 6;
                entity.player.runSpeed /= 6;
                entity.player.crouchSpeed /= 6;
            }

            if(message == '隐身'){
                entity.player.invisible = true;
            }

            if(message == '现身'){
                entity.player.invisible = false;
            }

            if(message == '还原'){
                entity.player.invisible = false;
                entity.player.scale = 1;
                entity.player.walkSpeed = 0.22;
                entity.player.runSpeed = 0.4;
                entity.player.crouchSpeed = 0.1;
            }
        }
    }
})
world.onPlayerJoin(({ entity }) => {
    // 使玩家发光
    entity.player.emissive = 1;
})
world.onPlayerJoin(({entity}) => {
    // 玩家进入游戏的时候缩小到0.25倍
    entity.player.scale = 0.5;
})

world.onTick(()=>{
    world.querySelectorAll('player').forEach((e)=>{
        if(e.position.y<0){
            if(Math.round(e.hp/3)===0){
                e.hurt(1);
            } else{
                e.hurt(Math.round(e.hp/3));
            }
            if(e.hp<=0){
                world.say('虚空杀喵了'+e.player.name);
            }
        }
    })
})
world.querySelectorAll('.飞机').forEach((e)=>{
      e.onEntityContact(({entity,other})=>{
         if(!other.isPlayer){return}
         other.mesh=entity.mesh;
         other.meshScale=entity.meshScale;
         other.player.invisible=true;
         other.player.canFly = true;
      })
})
//变形的代码
world.querySelectorAll('.实体标签').forEach((e)=>{
      e.onEntityContact(({entity,other})=>{
          other.player.canFly = true;
      })
})
//在跑酷终点设奖励的代码

 


回复

上一页1 页 / 共 1下一页
hecoshecos

emmmmm

点赞0


评论


hecoshecos

要代码直接跟我说

点赞0


评论


园丁园丁

world+=new Program(sketchProc());

点赞0


评论


高贵的木叶龙A35d高贵的木叶龙A35d

我自己找都比你找得多……

点赞0


评论


SYS一方通行SYS一方通行

Google Assistant

点赞0


评论


两个小八路两个小八路

这是我的星球大战源代码?

点赞0


评论


卫道士32_32*2没了卫道士32_32*2没了

(async function(){var _E4_BA_BA, _E4_BD_8D_E7_BD_AE, _E6_AC_A1_E6_95_B0, i;
_E4_BA_BA = '我不是吉吉喵';//保护的人
_E4_BD_8D_E7_BD_AE = new Box3Vector3(50,50,50);//浆糊派收容点
_E6_AC_A1_E6_95_B0 = 123;//浆糊派道歉次数
world.querySelector("."+'player').onClick(async ({entity,clicker,button})=>{
  if (entity.player.name == _E4_BA_BA) {
    clicker.hurt(100);
    clicker.say(['对不起,@',_E4_BA_BA,'我以后不打你了'].join(''));
    await sleep(1000);
      for (var count = 0; count < _E6_AC_A1_E6_95_B0; count++) {
        clicker.say('我不是人');
      }
      await sleep(1000);
      entity.say('解气了');
      while (true) {
        entity.hp=100;
        clicker.position=_E4_BD_8D_E7_BD_AE;
        for (i = 0; i <= 5; i++) {
          clicker.position=_E4_BD_8D_E7_BD_AE;
          clicker.player.color=new Box3RGBColor(i * 51,0,0);
          clicker.position=_E4_BD_8D_E7_BD_AE;
        }
        clicker.position=_E4_BD_8D_E7_BD_AE;
        for (i = 5; i >= 0; i--) {
          clicker.position=_E4_BD_8D_E7_BD_AE;
          clicker.player.color=new Box3RGBColor(i * 51,0,0);
          clicker.position=_E4_BD_8D_E7_BD_AE;
        }
        clicker.position=_E4_BD_8D_E7_BD_AE;
      }
  }
});
world.onPlayerJoin(async ({entity})=>{
  if (entity.player.name == _E4_BA_BA) {
    entity.player.canFly=true;
  }
});
})();

点赞0


评论