largeNumberGoeshere

checkforkey.lua

Apr 19th, 2021 (edited)
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. -- allows quick checking for a key being down (V2)
  2.  
  3.  
  4. function checkForKey(waitT)
  5.     waitT = waitT or 0.05
  6.     parallel.waitForAny(
  7.         function()
  8.             event,key = os.pullEvent("key")
  9.         end,
  10.         function()
  11.              sleep(waitT)
  12.              key=false
  13.              end
  14.     )
  15.     return key
  16. end
  17.  
  18. --key  = checkForKey(keys.a,2)
  19. --print(key)
  20.  
  21. return checkForKey
  22.  
Add Comment
Please, Sign In to add comment