用户:
希明墨雨工作室我是查看:11 回复: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小时
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
评论