Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- integer textureIsBeingAnimated;
- rotation AROUND; // full circle rotation
- integer ch=0; //Same unique 5 digit number as controller.
- string sound = "518b7cfb-d28f-5e59-05da-f93628d728c4";
- float delay = 0.05; // adjust speed of rotation
- integer side = ALL_SIDES; //Side to apply the texture to.
- // ALL_SIDES = All sides of the object.
- // Numbers 1-8 = Face number of the object.
- default
- {
- state_entry()
- {
- AROUND = llEuler2Rot(<0,10,0>*DEG_TO_RAD); // rotation constant
- llListen(ch,"",NULL_KEY,"");
- }
- listen(integer ch, string name, key id, string msg)
- {
- if (llGetOwner() == llGetOwnerKey(id))
- {
- string texture = llGetSubString(msg,0,-1);
- llTriggerSound(sound, 0.5);
- integer j;
- for ( j=0; j<720; j=j+10)
- {
- rotation rot = llList2Rot(llGetLinkPrimitiveParams(LINK_THIS, [PRIM_ROT_LOCAL]), 0);
- llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_ROT_LOCAL, rot*AROUND]);
- llSleep(delay);
- }
- float rot = 0;
- while(rot <= 358 * DEG_TO_RAD){
- rot += 2 * DEG_TO_RAD;
- llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TEXTURE, ALL_SIDES, texture, <1,1,0>, <0,0,0>, rot]);
- llSleep(0.02);
- }
- llSleep(3);
- rot = 0;
- while(rot <= 358 * DEG_TO_RAD){
- rot += 2 * DEG_TO_RAD;
- llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TEXTURE, ALL_SIDES, texture, <1,1,0>, <0,0,0>, rot]);
- llSleep(0.01);
- }
- llSleep(3);
- rot = 0;
- while(rot <= 358 * DEG_TO_RAD){
- rot += 2 * DEG_TO_RAD;
- llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_TEXTURE, ALL_SIDES, texture, <1,1,0>, <0,0,0>, rot]);
- llSleep(0.02);
- }
- llSleep(3);
- //do more stuff
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement