Advertisement
Mdr721

Key tutorial bh

Jun 1st, 2021
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //code by mdr721
  2. //Date June 1st,2021
  3.  
  4.  
  5.  
  6. // example from the doc
  7. // Game.on("initialSpawn", (player) => {
  8. //    player.speedCooldown = false
  9.  
  10. //    player.keypress(async(key) => {
  11. //        if (player.speedCooldown) return
  12. //        if (key === "shift") {
  13. //            player.speedCooldown = true
  14.  
  15. //            player.bottomPrint("Boost activated!", 3)
  16.  
  17. //            player.setSpeed(8)
  18.  
  19. //            await sleep(3000)
  20.  
  21. //            player.setSpeed(4)
  22.  
  23. //            player.bottomPrint("Boost cooldown...", 6)
  24.  
  25. //            setTimeout(() => {
  26. //                player.speedCooldown = false
  27. //            }, 6000)
  28. //        }
  29. //    })
  30. // })
  31.  
  32.  
  33. Game.on("initialSpawn", (player) =>{
  34.  
  35.     player.keypress(async(key) =>{
  36.  
  37.         console.log('pressed key: '+ key)
  38.  
  39.         if (key == 'shift'){
  40.  
  41.         }
  42.         if (key == 'e'){
  43.            
  44.         }
  45.         if (key == 'q'){
  46.            
  47.         }
  48.         if (key == 'r'){
  49.            
  50.         }
  51.  
  52.  
  53.  
  54.     })
  55.  
  56.  
  57. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement