Advertisement
Gayngel

Untitled

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