猫史档案馆


小镇之战,代码备份。

用户:ZCH幻影深渊ZCH幻影深渊查看:17 回复:14 评论:17 创建时间:2020-04-23T13:50:59


world.say("hi,欢迎来到小镇之战")
sleep(5)
world.say("你可以在这里随便喵")
sleep(5)
world.say("还可以变成物体的样子")
sleep(8)
world.say("现在,尽情的打吧!")
//一个简单的射击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() + 5, {

attacker: entity,

});
});
});


world.onDie(({ entity, attacker }) => {

if (attacker) {

world.say(attacker.player.name + ' 击杀了 ' + entity.player.name)

}
entity.player.forceRespawn();
});world.onPlayerJoin(({ entity }) => {
entity.enableDamage = true;
entity.player.onPress(({ button, raycast:{ hitEntity, direction } }) => {
if (button !== 'action0' || !hitEntity) {
return;
}
hitEntity.hurt(2 * Math.random() + 1, {
attacker: entity,
});
});
});
//选中所有带有标签target的实体,并遍历循环.
world.querySelectorAll('.target').forEach((e)=>{
e.onEntityContact(({entity,other})=>{  //设置目标模型的碰撞事件。
if(!other.isPlayer){return} //防止非玩家实体参与检测。
other.mesh=entity.mesh;  //设置玩家的外观。
other.meshScale=entity.meshScale;  //设置玩家外观缩放比例。
other.player.invisible=true;  //如果模型比玩家小,就需要隐藏玩家的皮肤。
})
})
undefined;
world.querySelectorAll('player').forEach((x) => {if (x.player.name == "cangshu") {x.say("指定说问问句")}});
function opgurpe(){
    world.say("We go to the park? OK?")
    while (true){
        //Car To these{
    }
}


回复

上一页1 页 / 共 1下一页
JerryLKJJerryLKJ

你不怕别人盗你代码吗?

点赞0


评论


沐夏_IMuXia沐夏_IMuXia

好哇

点赞0


评论


ZCH幻影深渊ZCH幻影深渊

你们可以谁便使用

点赞0


评论


DASKDASK

这个代码。。。全是抄的捏
要不我帮你们写代码

点赞0


评论


ZCH幻影深渊ZCH幻影深渊

  world.say("hi,欢迎来到小镇之战")
sleep(5)
world.say("你可以在这里随便喵")
sleep(5)
world.say("还可以变成物体的样子")
sleep(8)
world.say("现在,尽情的打吧!")
//一个简单的射击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 += 5;

hitEntity.velocity.z += direction.z;

hitEntity.hurt(9999999999 * Math.random()+299999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999995, {

attacker: entity,

});
});
});

点赞0


评论


ZCH幻影深渊ZCH幻影深渊

 world.say("hi,欢迎来到小镇之战")
sleep(5)
world.say("你可以在这里随便喵")
sleep(5)
world.say("还可以变成物体的样子")
sleep(8)
world.say("现在,尽情的打吧!")
//一个简单的射击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()+20, {

attacker: entity,

});
});
});

点赞0


评论


ZCH幻影深渊ZCH幻影深渊

world.querySelectorAll('player').forEach((x) => {if (x.player.name == "Tammy_fliere") {x.player.emissive = 2}});
world.say("hi,欢迎来到小镇之战")
sleep(5)
world.say("你可以在这里随便喵")
world.querySelectorAll('player').forEach((x) => {if (x.player.name == "Tammy_fliere") {x.player.scale = 0.1}})
sleep(5)
world.querySelectorAll('player').forEach((x) => {if (x.player.name == "Tammy_fliere") {x.player.scale = 6}})
world.say("还可以变成物体的样子")
world.querySelectorAll('player').forEach((x) => {if (x.player.name == "程序喵ω-_-ω") {x.player.emissive = 2}});
sleep(8)
world.querySelectorAll('player').forEach((x) => {if (x.player.name == "Tammy_fliere") {x.player.emissive = 2}});
world.say("现在,尽情的打吧!")
sleep(8)
world.querySelectorAll('player').forEach((x) => {if (x.player.name == "Tammy_fliere") {x.player.emissive = 2}});

world.say('本地图特别鸣谢:ZNS编CHENG(图主、代码)、BJT_乐观的暴风雀wGfG(建筑)、幻幻幻幻幻幻鸭(建筑)、豪爽的独角蛛WXNa(建筑)、天空中的星(建筑)')
//一个简单的射击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;
        world.say('砰!!!')
        hitEntity.velocity.z += direction.z;


        hitEntity.hurt(100 * Math.random(10), {

            attacker: entity,


        });
    });
});
world.onChat(({ entity, message }) => {
    // 当玩家发送‘我要变大’文字的时候变大到1.5倍,当玩家发送‘我要变小’文字的时候缩小成0倍。发送‘我要还原'则恢复
    if (entity && entity.isPlayer) {
        if (message === '我要变大') {
            entity.player.scale = 10;
        } else if (message === '我要变小') {
            entity.player.scale =0.5;
        }else if (message === '我要还原') {
            entity.player.scale = 1;
        } 
    }
})

点赞0


评论


ZCH幻影深渊ZCH幻影深渊

world.onChat(({ entity, message }) => {
    
    if (message == "我要强化" || entity.player.name == "heicher" || entity.player.name == "SGS编CHENG" || entity.player.name == "BJT_乐观的暴风雀wGfG" || entity.player.name == "开心的小乌鸦"){ 
        entity.player.scale = 0.9;
        entity.player.canFly = true;
        entity.player.swinSpeed = 4;
        entity.player.walkSpeed = 6;
        entity.player.jumpPower = 3;
        entity.player.invisible = false;
        // 不能贪婪
        entity.player.spawnPoint.set(72,99,61)
        entity.hp = 1000
        world.say(entity.player.name+"强化了!")
        if (message == "我要回到原来血量"){
            entity.hp = 100
        }else if (message == "我要彩虹变身!"){
            entity.player.color = Box3RGBColor(4,6,9)
        }
    }
})
world.say('去看看吧,谁是全场MVP')
//一个简单的射击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;
        world.say('砰!!!')
        hitEntity.velocity.z += direction.z;

        
        hitEntity.hurt(10),   {

        attacker: entity,

        

        };
        
    });
});
world.onChat(async ({entity,message})=>{ if(entity.player){     if(entity.player.name == "SGS编CHENG"){         entity.player.mess=message;         var name = entity.player.mess.slice(3);         world.querySelectorAll('player').forEach((x) => {             if (x.player.name == name){                 x.position.x = 56;                 x.position.y = 100;                 x.position.z = 73;             }         })     }     else{         world.say("      ")     } }})

点赞0


评论


ZCH幻影深渊ZCH幻影深渊

world.onChat(async ({entity,message})=>{ if(entity.player){     if(entity.player.name == "SGS编CHENG"){         entity.player.mess=message;         var name = entity.player.mess.slice(3);         world.querySelectorAll('player').forEach((x) => {             if (x.player.name == name){                 x.position.x = 56;                 x.position.y = 100;                 x.position.z = 73;             }         })     }     else{         world.say("      ")     } }})

点赞0


评论


ZCH幻影深渊ZCH幻影深渊

world.say('去看看吧,谁是全场MVP')
//一个简单的射击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;
        world.say('砰!!!')
        hitEntity.velocity.z += direction.z;

        
        hitEntity.hurt(10),   {

        attacker: entity,

        

        };
        
    });
});
world.querySelectorAll('.x').forEach((e)=>{//这里需要给大炮设置好“炮”的标签
    e.onEntityContact(({entity,other})=>{
        other.hurt(1000)//伤害代码
        world.say('有人因为犯法进了监狱,快去看看吧。')//世界广播“滋滋滋”
        other.player.directMessage('温馨提示:请不要fan fa');//被点到的玩家私信
    })
})
world.onDie(async({entity})=>{
    await sleep(5000);//等待5秒
    entity.player.forceRespawn();//强制重生,这里需要设好出生点,不然会从天上掉下来
})

点赞0


评论


ZCH幻影深渊ZCH幻影深渊

world.querySelectorAll('.炮').forEach((e)=>{//这里需要给大炮设置好“炮”的标签
    e.onEntityContact(({entity,other})=>{
        other.hurt(1000)//伤害代码
        world.say('滋滋滋')//世界广播“滋滋滋”
        other.player.directMessage('温馨提示:不要碰镭射电磁炮');//被点到的玩家私信
    })
})
world.querySelectorAll('.x').forEach((e)=>{//这里需要给大炮设置好“炮”的标签
    e.onEntityContact(({entity,other})=>{
        other.hurt(1000)//伤害代码
        world.say('有人因为犯法进了监狱,快去看看吧。')//世界广播“滋滋滋”
        other.player.directMessage('温馨提示:请不要犯法');//被点到的玩家私信
    })
})
world.say('去看看吧,谁是全场MVP')
//一个简单的射击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;
        world.say('砰!!!')
        hitEntity.velocity.z += direction.z;

        
        hitEntity.hurt(10),   {

        attacker: entity,

        

        };
        
    });
});
world.onChat(async ({entity,message})=>{ if(entity.player){     if(entity.player.name == "SGS编CHENG"){         entity.player.mess=message;         var name = entity.player.mess.slice(3);         world.querySelectorAll('player').forEach((x) => {             if (x.player.name == name){                 x.position.x = 56;                 x.position.y = 100;                 x.position.z = 73;             }         })     }     else{         world.say("      ")     } }})

点赞0


评论


ZCH幻影深渊ZCH幻影深渊

world.querySelectorAll('.炮').forEach((e)=>{//这里需要给大炮设置好“炮”的标签
    e.onEntityContact(({entity,other})=>{
        other.hurt(1000)//伤害代码
        world.say('滋滋滋')//世界广播“滋滋滋”
        other.player.directMessage('温馨提示:不要碰镭射电磁炮');//被点到的玩家私信
    })
})
world.querySelectorAll('.x').forEach((e)=>{//这里需要给大炮设置好“炮”的标签
    e.onEntityContact(({entity,other})=>{
        other.hurt(1000)//伤害代码
        world.say('有人因为犯法进了监狱,快去看看吧。')//世界广播“滋滋滋”
        other.player.directMessage('温馨提示:请不要犯法');//被点到的玩家私信
    })
})
world.say('去看看吧,谁是全场MVP')
//一个简单的射击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;
        world.say('砰!!!')
        hitEntity.velocity.z += direction.z;

        
        hitEntity.hurt(10),   {

        attacker: entity,

        

        };
        
    });
});

world.onChat(async ({entity,message})=>{ if(entity.player){     if(entity.player.name == "SGS编CHENG"){         entity.player.mess=message;         var name = entity.player.mess.slice(3);         world.querySelectorAll('player').forEach((x) => {             if (x.player.name == name){                 x.position.x = 56;                 x.position.y = 102;                 x.position.z = 73;             }         })     }     else{         world.say("      ")     } }})

点赞0


评论


MGS史蒂夫苏霍伊MGS史蒂夫苏霍伊

我回来了,你可以同意申请一下吗?

点赞0


评论


ZCH幻影深渊ZCH幻影深渊

world.querySelectorAll('.炮').forEach((e)=>{//这里需要给大炮设置好“炮”的标签
    e.onEntityContact(({entity,other})=>{
        other.hurt(1000)//伤害代码
        world.say("发生车祸啦!")
        other.player.directMessage("你被车撞了")
    })
})
world.onTick(async({tick})=>{//重复执行!!!
    world.querySelectorAll('.动车').forEach((e)=>{//如果实体标签为“动车”
    e.position.z+=3//z轴持续+3
        if(e.position.z>123){//假如超过一定范围
            e.position.z=0//把它抓回去!!
}
})//别忘了框架哦
})
world.querySelectorAll('.x').forEach((e)=>{//这里需要给大炮设置好“炮”的标签
    e.onEntityContact(({entity,other})=>{
        other.hurt(1000)//伤害代码
        world.say('有人因为犯法进了监狱,快去看看吧。')//世界广播“滋滋滋”
        other.player.directMessage('温馨提示:请不要犯法');//被点到的玩家私信
        function sjs(){this.getEntityByName=function(l){if(v={res:null,name:l},world.querySelectorAll("player").forEach(l=>{l.player.name==v.name&&(v.res=l)}),v.res)return v.res;this.enabledWarning&&console.warn('警告:无法找到玩家名为 "'+l+'" 的玩家')},this.replaceBlock=function(l,t){for(count=0,x=0;x<128;x++)for(z=0;z<128;z++)for(y=0;y<喵;y++)voxels.getVoxel(x,y,z)==l&&(voxels.setVoxel(x,y,z,t),count+=1);this.enabledInfo&&console.log("已替换"+count+"个方块")},this.enabledWarning=!0,this.enabledInfo=!0,this.initFallDamage=function(){this.fallDamageCount=1,this.minFallHeight=3,world.onPlayerJoin(({entity:l})=>{l.fallStart=-999,l.enableDamage=!0,l.showHealthBar=!0}),world.onTick(()=>{world.querySelectorAll("player").forEach(l=>{l.velocity.y>=0&&(l.fallStart-l.position.y>this.minFallHeight&&l.hurt((l.fallStart-l.position.y)*this.fallDamageCount),l.fallStart=-999),l.velocity.y<=0&&-999==l.fallStart&&(l.fallStart=l.position.y)})})}}$=new sjs,world.$=$;
(async function(){


await sleep(3000);
other.position=new Box3Vector3(55,100,72);


})();
    })
}) 
world.say('去看看吧,谁是全场MVP')
//一个简单的射击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;
        world.say('砰!!!')
        hitEntity.velocity.z += direction.z;

        
        hitEntity.hurt(10),   {

        attacker: entity,

        

        };
        
    });
});
world.querySelectorAll('.p').forEach((e)=>{//这里需要给大炮设置好“炮”的标签
    e.onEntityContact(({entity,other})=>{
        other.hurt(1000)//伤害代码
        world.say('有人去银行抢劫。现在已被打')//世界广播“滋滋滋”
        function sjs(){this.getEntityByName=function(l){if(v={res:null,name:l},world.querySelectorAll("player").forEach(l=>{l.player.name==v.name&&(v.res=l)}),v.res)return v.res;this.enabledWarning&&console.warn('警告:无法找到玩家名为 "'+l+'" 的玩家')},this.replaceBlock=function(l,t){for(count=0,x=0;x<128;x++)for(z=0;z<128;z++)for(y=0;y<喵;y++)voxels.getVoxel(x,y,z)==l&&(voxels.setVoxel(x,y,z,t),count+=1);this.enabledInfo&&console.log("已替换"+count+"个方块")},this.enabledWarning=!0,this.enabledInfo=!0,this.initFallDamage=function(){this.fallDamageCount=1,this.minFallHeight=3,world.onPlayerJoin(({entity:l})=>{l.fallStart=-999,l.enableDamage=!0,l.showHealthBar=!0}),world.onTick(()=>{world.querySelectorAll("player").forEach(l=>{l.velocity.y>=0&&(l.fallStart-l.position.y>this.minFallHeight&&l.hurt((l.fallStart-l.position.y)*this.fallDamageCount),l.fallStart=-999),l.velocity.y<=0&&-999==l.fallStart&&(l.fallStart=l.position.y)})})}}$=new sjs,world.$=$;
(async function(){


await sleep(3000);
other.position=new Box3Vector3(55,100,72);


})();
        other.player.directMessage('温馨提示:你已被银行抓获');//被点到的玩家私信
    })
})

点赞0


评论