Advertisement
Guest User

spinny

a guest
Jun 24th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. integer textureIsBeingAnimated;
  2. rotation AROUND;           // full circle rotation
  3.  
  4. integer ch=0;         //Same unique 5 digit number as controller.
  5.  
  6. string sound = "518b7cfb-d28f-5e59-05da-f93628d728c4";
  7.  
  8. float delay = 0.05;        // adjust speed of rotation
  9.  
  10. integer side = ALL_SIDES;   //Side to apply the texture to.
  11.                             // ALL_SIDES = All sides of the object.
  12.                             // Numbers 1-8 = Face number of the object.
  13.  
  14. default
  15. {
  16.     state_entry()
  17.     {
  18.         AROUND = llEuler2Rot(<0,10,0>*DEG_TO_RAD); // rotation constant
  19.         llListen(ch,"",NULL_KEY,"");
  20.     }
  21.  
  22.     listen(integer ch, string name, key id, string msg)
  23.     {  
  24.         if (llGetOwner() == llGetOwnerKey(id))
  25.         {
  26.             string texture = llGetSubString(msg,0,-1);
  27.             llTriggerSound(sound, 0.5);
  28.             integer j;
  29.             for ( j=0; j<720; j=j+10)
  30.             {
  31.                 rotation rot = llList2Rot(llGetLinkPrimitiveParams(LINK_THIS, [PRIM_ROT_LOCAL]), 0);
  32.                 llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROT_LOCAL, rot*AROUND]);
  33.                 llSleep(delay);
  34.             }
  35.             float rot = 0;
  36.             while(rot <= 358 * DEG_TO_RAD){
  37.                 rot += 2 * DEG_TO_RAD;
  38.                 llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TEXTURE, ALL_SIDES, texture, <1,1,0>, <0,0,0>, rot]);
  39.                 llSleep(0.02);
  40.             }
  41.             llSleep(3);
  42.             rot = 0;
  43.             while(rot <= 358 * DEG_TO_RAD){
  44.                 rot += 2 * DEG_TO_RAD;
  45.                 llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TEXTURE, ALL_SIDES, texture, <1,1,0>, <0,0,0>, rot]);
  46.                 llSleep(0.01);
  47.             }
  48.             llSleep(3);
  49.             rot = 0;
  50.             while(rot <= 358 * DEG_TO_RAD){
  51.                 rot += 2 * DEG_TO_RAD;
  52.                 llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TEXTURE, ALL_SIDES, texture, <1,1,0>, <0,0,0>, rot]);
  53.                 llSleep(0.02);
  54.             }
  55.             llSleep(3);
  56.             //do more stuff
  57.         }
  58.     }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement