Advertisement
osmarks

antigrav

Jan 6th, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. local mods = peripheral.wrap "back"
  2. local owner = "gollark"
  3.  
  4. while true do
  5. local meta = mods.getMetaByName(owner)
  6. -- We calculate the required motion we need to take
  7. local mY = meta.motionY
  8. mY = (mY - 0.138) / 0.8
  9.  
  10. -- If it is sufficiently large then we fire ourselves in that direction.
  11. if mY > 0.5 or mY < 0 then
  12. local sign = 1
  13. if mY < 0 then sign = -1 end
  14. mods.launch(0, 90 * sign, math.min(4, math.abs(mY)))
  15. end
  16. sleep()
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement