Advertisement
_Ziper_YT_

rocket

Jun 23rd, 2025 (edited)
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. start = 1
  2.  
  3. relay = peripheral.wrap("redstone_relay_4")
  4. -- Отключаем выводы
  5. relay.setOutput("front", false)
  6. relay.setOutput("back", false)
  7. rs.setOutput("front", false)
  8. rs.setOutput("back", false)
  9.  
  10. if start == 1 then
  11. local pos = ship.getWorldspacePosition()
  12. local y = pos.y
  13. -- Включаем двигатели на подъём
  14. rs.setOutput("front", true)
  15. rs.setOutput("back", true)
  16. -- Ждём
  17. while pos.y < 170 do
  18.     pos = ship.getWorldspacePosition()
  19.     sleep(0.5)
  20. end
  21. -- Включаем двигатели на возврат
  22. relay.setAnalogOutput("front", 15)
  23. relay.setAnalogOutput("back", 15)
  24. -- Отключаем двигатели на подъём
  25. rs.setOutput("front", false)
  26. rs.setOutput("back", false)
  27. -- Ждём
  28. sleep(3)
  29. -- Отключаем двигатели на возврат
  30. relay.setOutput("front", false)
  31. relay.setOutput("back", false)
  32. sleep(600)
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement