Guest User

Untitled

a guest
Apr 1st, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // llSetLocalRot Door
  2. // by Kelley Earthenleven [Celeborn Longoria]
  3.  
  4. integer open;
  5. string creaking_sound = "8902c190-ae9f-1d65-5e73-34685cfc5502";
  6. open_it()   { integer n; for(n=1;n<=10;n++) llSetLocalRot(llEuler2Rot(<0.0, 0.0, 0.1 * PI_BY_TWO>)*llGetLocalRot());   }
  7. close_it()  { integer n; for(n=1;n<=10;n++) llSetLocalRot(llEuler2Rot(<0.0, 0.0, -0.1 *PI_BY_TWO>)*llGetLocalRot());   }    
  8.  
  9. default
  10. {
  11.     state_entry()           {                                               }
  12.     touch_end(integer n)    { llSetTimerEvent(20); state motion;            }
  13.     timer()                 { llSetTimerEvent(0); if(open) state motion;    }
  14. }
  15.  
  16. state motion
  17. {
  18.     state_entry()
  19.     {
  20.         llPlaySound(creaking_sound,1.0);
  21.         if(!open) open_it();
  22.         if(open)  close_it();
  23.         open=!open;
  24.         state default;
  25.     }
  26. }
Add Comment
Please, Sign In to add comment