Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. {
  2. declare waist is 0.
  3.  
  4. function playerControl {
  5. local val is ship:control:pilotroll.
  6. if val <> 0 {
  7. set waist:speed to 2 * val * val.
  8. print waist:speed.
  9. if val < 0 { waist:moveleft(). } else { waist:moveright(). }
  10. } else if waist:ismoving {
  11. waist:stop().
  12. }
  13. }
  14.  
  15. function startup {
  16. for s in addons:ir:allservos {
  17. if s:part:tag = "waist" { set waist to s. }
  18. }
  19. set waist:acceleration to 10.
  20. }
  21.  
  22. global start is startup@.
  23. global pcontrol is playerControl@.
  24. }
  25.  
  26. start().
  27.  
  28. until (false) {
  29. pcontrol().
  30. wait 0.1.
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement