猫史档案馆


幻乐之城 源代码公开!(内附惊喜)

用户:蓝猫sir诈尸了嗨嘿嗨蓝猫sir诈尸了嗨嘿嗨查看:7 回复:2 评论:7 创建时间:2020-07-06T14:13:50


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------防喵-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

dconsole.clear()
world.say('欢迎来到幻乐之城')
sleep(5)
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.onPlayerJoin(({entity})=>{
if(entity.player.name=='勇敢的阿尔法r9sy'||entity.player.name=='你的名字'){//这
entity.player.canFly=true;
entity.player.color.r=2;
entity.player.color.g=1;
entity.player.color.b=0;
world.say('欢迎管喵'+entity.player.name+'来到地图')
}
})
world.onPlayerJoin(({entity})=>{
if(entity.player.name=='HMC星河晶梦'||entity.player.name=='你的名字'){//这
entity.player.canFly=true;
entity.player.color.r=2;
entity.player.color.g=1;
entity.player.color.b=0;
world.say('欢迎作者'+entity.player.name+'来到地图')
}
})
world.onPlayerJoin(({entity})=>{
if(entity.player.name=='MX萌新家族'||entity.player.name=='你的名字'){//这
entity.player.canFly=true;
entity.player.color.r=2;
entity.player.color.g=1;
entity.player.color.b=0;
world.say('欢迎管喵'+entity.player.name+'来到地图')
}
})
world.onPlayerJoin(({entity})=>{
if(entity.player.name=='金钱鼠'||entity.player.name=='你的名字'){//这
entity.player.canFly=true;
entity.player.color.r=2;
entity.player.color.g=1;
entity.player.color.b=0;
world.say('欢迎管喵'+entity.player.name+'来到地图')
}
})
world.onPlayerJoin(({entity})=>
(entity.player.name=='MX萌新家族'||entity.player.name=='你的名字')
.player.canFly=true;
entity.player.color.r=2;
entity.player.color.g=1;
entity.player.color.b=0;
world.say('欢迎作者'+entity.player.name+'来到地图')
}
})


}
})
world.onPlayerJoin(({entity})=>{
entity.position.set(60, 15, 120);//玩家进来的时候,将ta传送到指定的坐标
entity.player.spawnPoint.copy(entity.position);//将玩家复活点复制为上面的坐标
})
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.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 = 54; x.position.y = 9; x.position.z = 84; } }) } else{ world.say(" ") }}})world.say('喵');



world.querySelectorAll(".龙舟").forEach(e=>{
e.onEntityContact(({entity,other})=>{
if(!other.isPlayer){return}
other.mesh=entity.mesh;
world.say(""+entity.meshScale)
other.meshScale=entity.meshScale;
other.player.invisible=true;
})})

emotion_编程猫_厉害了emotion_编程猫_厉害了

惊喜福利:

3.0内测欢乐之城5.0环境美化工程招募在即,各位想要加入欢乐之城(兼萌新合作社代码岛总部)5.0工程部的训练师回帖报名哦~

(被选中的训练师萌新会在24小时内在你的作品底下偷偷把链接@你哦~)

 

 


回复

上一页1 页 / 共 1下一页
蓝猫sir诈尸了嗨嘿嗨蓝猫sir诈尸了嗨嘿嗨

4.0效果1图猛戳→https://shequ.codemao.cn/community/312880

点赞0


评论


文件传输助脚文件传输助脚

全部白嫖代码,要脸不?

点赞1


评论