用户:
蒟蒻OIer1048576查看:2 回复:4 评论:2 创建时间:2020-06-05T08:53:48
let playerNumbers = world.querySelectorAll("player").length
world.say(playerNumbers)
let state = []
let Rebirth_point = []
//
for(let i = 0;i < playerNumbers,i++;){
state.push(world.querySelectorAll("player")[i].position.y >= 10.5)
Rebirth_point.push([77,9,20])
}
function round(num){
return parseInt(num+0.5)
}
world.say("debuging....")
world.say("大家试试进入重生点吧")
let temp = 0
let x_,y_,z_ = 0
{
setInterval(
()=>{
//TODEBUG
temp = 0
world.querySelectorAll('player').forEach((x) => {
world.say("正在检测"+x.player.name+"的状态")
world.say(world.querySelectorAll("player").length)
x_ = round(x.position.x)
y_ = round(x.position.y)
z_ = round(x.position.z)
if (y <= 10.5 && state[temp]) {x.position.set(Rebirth_point[temp][0],Rebirth_point[temp][1],Rebirth_point[temp][2]);
world.say(x.player.name+"被传送回出生点")
}
if (x_ == 118&&y_ == 36&&z_ == 65){
world.say(x.player.name,+"进入第一重生点")
Rebirth_point[temp] = [118,36,65] //这么做
}
else if (x_ == 98&&y_ == 42&&z_ == 113){
world.say(x.player.name+"进入第二重生点")
Rebirth_point[temp] = [98,42,113] //这么做
}
world.say(x.player.name+"的x:"+x_+"的y:"+y_+"的z:"+z_)
world.say(x.player.name+"的重生点是"+Rebirth_point[temp][0]+"&"+Rebirth_point[temp][1]+"&"+Rebirth_point[temp][2])
temp++
world.say(temp+"")
});
},100
)
};
我真nm不是player被