用户:yee剑走天下查看:5 回复:7 评论:5 创建时间:2022-07-04T15:14:53
这不()跑酷最烦人的就是找捷径跳关的人吗())(() 所以我就逊逊地写了几行代码() 基本上可以有效防治跳关yee))) 上代码())(() console.clear(); world.onPlayerJoin(({entity})=>{ entity.lv=0; entity.enableDamage=true; }); world.querySelectorAll('*').forEach((e)=>{ if(e.id.startsWith('闪光存档点')){ e.collides=true; e.fixed=true; e.enableInteract=true; e.interactHint=`第${e.tags()}关`; e.interactColor.set(1,0,1); e.interactRadius=5; e.onEntityContact(({other})=>{ if(other.isPlayer){ if(Number(e.tags())==other.lv+1){ if(other.player.spawnPoint!=e.position){ other.player.directMessage('到达新的重生点'); other.player.spawnPoint=e.position; other.lv=Number(e.tags()); } }else{ if(other.lv==Number(e.tags())){ return; }else{ other.hurt(100); other.player.directMessage('你进错了存档点!');//给玩家发消息 other.position.copy(other.player.spawnPoint); other.position.y+=4; other.hp=other.maxHp; } } } }) } }) 注:要给模型打上标签,标签数字就行,比如说第三关,就给模型打上标签3即可 然后模型的模型名也可以自己改()startsWith那里自行调整()() yee)))看到这里()快去box3.codemao.cn/u/YJZTX202110给我个关注(什())(()()
console.clear();
world.onPlayerJoin(({ entity }) => {
entity.lv = 0;
entity.enableDamage = true;
});
world.querySelectorAll('*').forEach((e) => {
if (e.id.startsWith('闪光存档点')) {
e.collides = true;
e.fixed = true;
e.enableInteract = true;
e.interactHint = `第${e.tags()}关`;
e.interactColor.set(1, 0, 1);
e.interactRadius = 5;
e.onEntityContact(({ other }) => {
if (other.isPlayer) {
if (Number(e.tags()) == other.lv + 1) {
if (other.player.spawnPoint != e.position) {
other.player.directMessage('到达新的重生点');
other.player.spawnPoint = e.position;
other.lv = Number(e.tags());
}
} else {
if (other.lv == Number(e.tags())) {
return;
} else {
other.hurt(100);
other.player.directMessage('你进错了存档点!');// 给玩家发消息
other.position.copy(other.player.spawnPoint);
other.position.y += 4;
other.hp = other.maxHp;
}
}
}
})
}
})点赞1
评论