Advertisement
Gayngel

Untitled

Feb 5th, 2015
669
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. integer swing=1;
  2. integer pullLever;
  3.  
  4. default
  5. {
  6.  
  7. on_rez(integer start_param)
  8. {
  9. llResetScript();
  10. }
  11.  
  12. touch_end(integer total_number)
  13. {
  14. llPassTouches(FALSE);
  15. }
  16.  
  17. link_message(integer source, integer num, string str, key id)
  18. {
  19.  
  20.  
  21. if (str = "On")
  22. {
  23. state toggleLever;
  24. }
  25.  
  26. }
  27. }
  28.  
  29.  
  30. state toggleLever
  31. {
  32. touch_end(integer total_number)
  33.  
  34. {
  35.  
  36. llPassTouches(FALSE);
  37.  
  38.  
  39.  
  40. pullLever =!pullLever;
  41. if (pullLever)
  42. {
  43.  
  44. llPlaySound("lever", 1.0);
  45. llSleep(1.7);
  46. llPlaySound("takeoff bell", 1.0);
  47. llSleep(1.5);
  48. rotation rot = llGetLocalRot();
  49. rotation delta = llEuler2Rot(<-PI/4*swing,0,0>);
  50. rot = delta * rot;
  51. llSetLocalRot(rot);
  52. llSleep(0.25);
  53. rot = delta * rot;
  54. llSetLocalRot(rot);
  55. llPlaySound("Tardis Takeoff", 1);
  56. llSay(12,"takeoff");
  57. llSay(0,"takeoff");
  58. llSetText("Dematerialising...", <1,1,1>, 1.0);
  59. llSleep(9.3);
  60. llLoopSound("inflight", 6.0);
  61. llSetText("In Transit", <1,1,1>, 1.0);
  62.  
  63. }
  64.  
  65. else if (!pullLever)
  66. {
  67.  
  68. //llTriggerSound("tardis door close",9.9);
  69. llSay(12,"land");
  70. llSay(0,"land");
  71. llPlaySound("tardis2", 1);
  72. llSetText("Materialising...", <1,1,1>, 1.0);
  73. llSleep(6.0);
  74. llSetText("Landed", <1,1,1>, 1.0);
  75. llSleep(0.5);
  76. rotation rot = llGetLocalRot();
  77. rotation delta = llEuler2Rot(<PI/4*swing,0,0>);
  78. rot = delta * rot;
  79. llSetLocalRot(rot);
  80. llSleep(0.25);
  81. rot = delta * rot;
  82. llSetLocalRot(rot);
  83.  
  84. }
  85. }
  86. link_message(integer source, integer num, string str, key id)
  87. {
  88. if (str = "Off")
  89. {
  90.  
  91. state default;
  92.  
  93. }
  94. }
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement