Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // llSetLocalRot Door
- // by Kelley Earthenleven [Celeborn Longoria]
- integer open;
- string creaking_sound = "8902c190-ae9f-1d65-5e73-34685cfc5502";
- open_it() { integer n; for(n=1;n<=10;n++) llSetLocalRot(llEuler2Rot(<0.0, 0.0, 0.1 * PI_BY_TWO>)*llGetLocalRot()); }
- close_it() { integer n; for(n=1;n<=10;n++) llSetLocalRot(llEuler2Rot(<0.0, 0.0, -0.1 *PI_BY_TWO>)*llGetLocalRot()); }
- default
- {
- state_entry() { }
- touch_end(integer n) { llSetTimerEvent(20); state motion; }
- timer() { llSetTimerEvent(0); if(open) state motion; }
- }
- state motion
- {
- state_entry()
- {
- llPlaySound(creaking_sound,1.0);
- if(!open) open_it();
- if(open) close_it();
- open=!open;
- state default;
- }
- }
Add Comment
Please, Sign In to add comment