Lv.1
大家快快关注吧! 目标:200粉500赞 ! 作品全部开源!(除重要) 预备作品中
签名:在做新的电脑(作品)
在 创作喵码无辜报错!希望官方进行修复! 中回复
(我看了这帖笑了半天)你用用
world.onPlayerJoin(({entity})=>{entity.player.kick()})
()()()()()()
2022-08-13T23:18:33 点赞:1
在 【震惊!屑智慧竟有时间开教程】 中回复
team=4//可改,队数
team2=["red","blue","yellow","green"]//队所对应的队名
world.teams=[]
world.onPlayerJoin(({entity})=>{
entity.ining=0
entity.randoms=0
entity.mining=0
entity.toye=0
entity.falealow=[]
entity.a=[]
entity.thewords=0
entity.leaf=0
})
console.clear()
function addd(){ining=1;break}
function random(minNum,maxNum){
switch(arguments.length){
case 1:
return parseInt(Math.random()*minNum+1,10);
break;
case 2:
return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10);
break;
default:
return 0;
break;
}
}
var searchInsert = function(nums, target) {
let arr=nums
arr.splice(0,0,target)
return nums.indexOf(target)>0?nums.indexOf(target):arr.sort((a,b)=>a-b).indexOf(target)
};
function toTeams(zhi,entity){
zhi1=[1,0,2,0]//分队颜色,自己填
zhi2=[0,0,2,1]//
zhi3=[0,1,0,0]//
entity.player.color.set(zhi1[zhi],zhi2[zhi],zhi3[zhi])
}
world.onPlayerJoin(async({entity})=>{
for(var i=0;i<=team-1;i++)world.teams.push([]);
for(var i=0;i<=team-1;i++)i==0 ? entity.thewords=world.teams[i].lenth : entity.thewords==world.teams[i].lenth ? null : addd();
if(entity.ining){
for(i in world.teams)entity.a.push(world.teams[i])
entity.mining=Math.min.apply(null, entity.a)
for(i in world.teams) if(world.teams[i].length==entity.mining){entity.toye+=1;entity.falealow.push(team2[i])}
entity.randoms=random(0,toye-1);
world.teams[searchInsert(team2,entity.falealow[entity.randoms])].push(entity.player.name);
world.say('in...'+entity.falealow[entity.randoms])
toTeams(searchInsert(team2,entity.falealow[entity.randoms]),entity)
}else if (entity.ining==0){
entity.randoms=random(0,team-1);
world.teams[entity.randoms].push(entity.player.name);
world.say('in...'+team2[entity.randoms]) ;
toTeams(entity.randoms,entity)
}
//world.say(teams)
})2022-09-30T20:52:39 点赞:0