猫史档案馆


加速带代码

用户:梁桂琪梁桂琪查看:0 回复:0 评论:0 创建时间:2021-12-05T14:07:39


const nb = world.querySelector("#加速带")
nb.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 *= 3
        other.player.runAcceleration *= 3

        await sleep (1000)
        
        other.player.runspeed = oldspeed
        other.player.runAcceleration = oldAccel

        other.speedUp = false
     }
})


回复

上一页1 页 / 共 0下一页