
Lv.1
伏特加、威士忌、白兰地。
签名:倘若一个错误所关联的两方都心照不宣地漠视了当中的荒谬之处,那么这个错误就具备了长久存续下去的条件。
在 游戏咋档存记录 中回复
第一种:模型存档
//存档点:可放置多个,需要加存档点标签,同时存档点需要开实体化,可推移要关掉
world.querySelectorAll('.存档点').forEach((e)=>{
e.onEntityContact(({entity,other})=>{
if(other.player.Start==true){
other.player.spawnPoint.copy(other.position);
other.player.directMessage('存档成功!')
}
})
})
第二种:方块存档(踩S存档)
world.onVoxelContact(({voxel,entity})=>{
const c=voxels.id('S');//也可以是别的方块
if(voxel===c){
entity.player.directMessage('存档成功!);
entity.player.spawnPoint.copy(entity.position);
}
})
2、起点的提示(加起点标签,开实体关防推移)
world.onPlayerJoin(({entity})=>{
entity.player.Start=false;//跑酷起点判断,防作弊
entity.enableDamage=true;//可伤害
})
//跑酷起点
world.querySelectorAll('.起点').forEach((e)=>{
e.onEntityContact(({entity,other})=>{
if(other.player.Start==false){
world.say(other.player.name+'出发了!');
other.player.Start=true;
other.player.spawnPoint.copy(other.position);
}
})
})
3、不想说了太简单,一行就可以了
//跑酷快速传送门
world.querySelectorAll('.跑酷传送门').forEach((e)=>{e.onEntityContact(({entity,other})=>{other.position.set(124, 23, 68);})})//填自己的坐标,标签跟前面一样,怎么做就怎么做
4、一样的简单,也是1行(才怪)
world.querySelectorAll('.终点').forEach((e)=>{
e.onEntityContact(({entity,other})=>{
other.player.directMessage('你到了终点!获得加速效果!(蹲下加速)以及发光!')
world.say(other.player.name+'到达了终点!')
other.player.Start=false;
other.player.emissive=999;
other.position.set(73, 10, 77);//这里填出生点坐标
other.player.spawnPoint.copy(other.position);
})
})
5、需要配合上面代码
//如果玩家跑酷中,一到地上就凉凉
world.onTick(({entity})=>{
world.querySelectorAll('player').forEach((e)=>{
if(e.player.Start==true){
if(e.position.y<=15){
e.hurt(999)
}
}
})
})
如果连起来,就是:
//跑酷起点
world.querySelectorAll('.起点').forEach((e)=>{
e.onEntityContact(({entity,other})=>{
if(other.player.Start==false){
world.say(other.player.name+'出发了!');
other.player.Start=true;
other.player.spawnPoint.copy(other.position);
}
})
})
//存档点:可放置多个,需要加存档点标签,同时存档点需要开实体化,可推移要关掉
world.querySelectorAll('.存档点').forEach((e)=>{
e.onEntityContact(({entity,other})=>{
if(other.player.Start==true){
other.player.spawnPoint.copy(other.position);
other.player.directMessage('存档成功!')
}
})
})
//如果玩家跑酷中,一到地上就凉凉
world.onTick(({entity})=>{
world.querySelectorAll('player').forEach((e)=>{
if(e.player.Start==true){
if(e.position.y<=15){
e.hurt(999)
}
}
})
})
//跑酷快速传送门
world.querySelectorAll('.跑酷传送门').forEach((e)=>{e.onEntityContact(({entity,other})=>{other.position.set(124, 23, 68);})})
(这里用了模型存档)
2020-06-03T09:19:14 点赞:0