用户:
Ninesir查看:0 回复:1 评论:0 创建时间:2022-04-09T23:52:46
最近二创活动刚出,今天来分享一些代码供大家参考,代码来源地图网址https://box3.codemao.cn/e/5d54b9dba3063a70b22f?p=Tc5QxDYA4agNJpwCIVR8QrE2qiPxh1CXn8PE6E38TVA4uTryGBMAnlj4Lop4LogIU%3D(24小时内有效) //管喵权限 varcanfly=['玩家id',] world.onPlayerJoin(({entity})=>{ if(canfly.includes(entity.player.name)){ Object.assign(entity,{ particleRate:200, particleSize:[1,2,3,4,5], particleColor:[ newBox3RGBColor(10,0,0), newBox3RGBColor(0,10,0), newBox3RGBColor(0,0,10), ], particleLifetime:1, particleVelocitySpread:newBox3Vector3(0,0,0), }); entity.player.canFly=true; } }); //有人不听话? if(message.startsWith('禁言')){ if(message.slice(2)==entity.player.name){ entity.player.directMessage('无法禁言自己,请重新尝试!') }else{ world.querySelectorAll('player').forEach((x)=>{ if(x.player.name==message.slice(2)){ x.player.directMessage('你已被管喵禁言,请等待管喵解除') world.say('有人犯了错,被管喵禁言了!') x.player.muted=true } }) } } if(message.startsWith('解除禁言')){ if(message.slice(4)==entity.player.name){ entity.player.directMessage('无法解除禁言自己,请重新尝试!') }else{ world.querySelectorAll('player').forEach((x)=>{ if(x.player.name==message.slice(4)){ x.player.directMessage('你已被管喵解除禁言') world.say('有人已被管喵解除禁言了!') x.player.muted=false } }) } } } } }); //欢迎玩家 constmap_name=('地图名称') world.onPlayerJoin(({entity})=>{ entity.player.forceRespawn(); entity.player.juice=0; entity.player.directMessage(`欢迎@${entity.player .name},来到${map_name}\n`); })