SHARE
TWEET

Fly

a guest May 21st, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local modules = peripheral.find("neuralInterface")
  2. if not modules then
  3.     error("Must have a neural interface", 0)
  4. end
  5. local meta = {}
  6. local hover = false
  7. parallel.waitForAny(
  8. function()
  9.         while true do
  10.             local event, key = os.pullEvent()
  11.             if event == "key" and key == keys.o then
  12.                 -- The O key launches you high into the air.
  13.                 modules.launch(0, -90, 3)
  14.             elseif event == "key" and key == keys.p then
  15.                 -- The P key launches you a little into the air.
  16.                 modules.launch(0, -90, 1)
  17.             elseif event == "key" and key == keys.l then
  18.                 -- The l key launches you in whatever direction you are looking.
  19.                 modules.launch(meta.yaw, meta.pitch, 3)
  20.             elseif event == "key" and key == keys.k then
  21.                 -- Holding the K key enables "hover" mode. We disable it when it is released.
  22.                 if not hover then
  23.                     hover = true
  24.                     os.queueEvent("hover")
  25.                 end
  26.             elseif event == "key_up" and key == keys.k then
  27.                 hover = false
  28.             end
  29.         end
  30.     end,
  31.  
  32. function()
  33.         while true do
  34.             meta = modules.getMetaOwner()
  35.         end
  36.     end)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top