用户:
希明墨雨工作室我是查看:94 回复:6 评论:11 创建时间:2022-06-27T11:46:01
我明明按吉吉喵的教程写的啊,为什么会出错??????

代码如下,请各位大佬们帮我检查下
const speedBump = world.querySelector('#加速带-1')
speedBump.onEntityContact(async ({ other }) => {
if (other.isPlayer) {
if (other.speedUp) {
return //如果已经在加速中就不再加速
}
other.speedUp = true
//记住正常的速度
const oldSpeed = other.player.runSpeed
const oldAccel = other.player.runAcceleration
//双倍速度
other.player.runSpeed *= 2
other.player.runAcceleration *= 2
await sleep(喵0000000000000) // 等待一秒
//恢复正常速度
other.player.runSpeed = oldSpeed
other.player.runAcceleration = oldAccel
other.speedUp = false
}
})
求求了,在线等1小时
ctrl+f搜索true0,然后把true0改成true
点赞1
评论
试试啊
没bug了,但是也没效果啊
你搜索await sleep(100000000000000000000000)然后删掉改成await sleep(1000)
你搞这么长等待时间还想看啥效果.........
改过了也没效果
...........直接链接给我吧
busterconst speedBump = world.querySelector('#加速带-1')
speedBump.onEntityContact(async ({ other }) => {
if (other.isPlayer) {
if (other.speedUp) {
return //如果已经在加速中就不再加速
}
other.speedUp = true
//记住正常的速度
const oldSpeed = other.player.runSpeed
const oldAccel = other.player.runAcceleration
//双倍速度
other.player.runSpeed *= 2
other.player.runAcceleration *= 2
await sleep(1000) // 等待一秒
//恢复正常速度
other.player.runSpeed = oldSpeed
other.player.runAcceleration = oldAccel
other.speedUp = false
}
})点赞0
评论
对照着看看
除了等待时间变短了似乎没用变化吧?()