猫史档案馆


【求助】喵后,无法返回“复活点”

用户:豆爸0ENG豆爸0ENG查看:4 回复:10 评论:4 创建时间:2021-12-19T13:19:25


//根据吉吉喵的教程,我做了一个喵亡后返回“复活点”=>结果出了BUG~~//    

~谁来解答一下~  

center_image


回复

上一页1 页 / 共 1下一页
全能代码师全能代码师

你看看哪个模型真正的名字是不是复活点-1

点赞1


评论


Stephan轩Stephan轩

没有“复活点”这个模型,所以position也不存在

点赞0


评论


DianfenghhDianfenghh

const respawnPoint = world.querySelector(`#存档点`)

 

world.onVoxelContact(({entity, voxel})=> {     const voxelName = voxels.name(voxel);     if (voxelName === 'lava02'){

 

        entity.hurt(100)     } })

 

for (const e of world.querySelectorAll('*')) {     if (e.id.startsWith('存档点')) {         e.collides = true          e.fixed = true 

 

        e.onEntityContact(({ other }) => {              if (other.isPlayer) {                  if (e.position !== other.player.spawnPoint) {                      other.player.directMessage('到达新的重生点')                      other.player.spawnPoint = e.position                  }             }         })     } }

 

world.onPlayerJoin(({ entity }) => {     entity.onFluidEnter(() => {         entity.position.copy(entity.player.spawnPoint)         entity.position.y += 4     }) })

 

world.onPlayerJoin(({ entity }) => {     entity.enableDamage = true     entity.onDie(() => {

 

        entity.player.forceRespawn()     }) })

点赞0


评论


DianfenghhDianfenghh

#存档点 哪里把存档点改为你存档点模型的名字

点赞0


评论


DianfenghhDianfenghh

1:

center_image

点赞0


评论


DianfenghhDianfenghh

2:

center_image

点赞0


评论


DianfenghhDianfenghh

TypeError. Cannot read property 'position' of null

类型错误。无法读取空的属性“位置”

点赞0


评论


DianfenghhDianfenghh

实在不行从这里搬运: https://box3.codemao.cn/e/f9ca18910c4c8c00598f?p=ETlFQWJki4hHMTIDypejY0q8xVxB5S9ukR2PsgX88CA7u7pzfdLwEx

点赞1


评论


TBRO魔导师TBRO魔导师

你模型名叫复活点-1还是复活点

 

点赞0


评论


DianfenghhDianfenghh

https://www.bilibili.com/video/BV17f4y1x7qB?spm_id_from=333.999.0.0

点赞0


评论