AS Texture Animation

From Second Life Wiki
Jump to navigation Jump to search

<lsl>

/*

 Animate the texture showing on all prims
 in the linkset named "EYE"
  • /

// internal values list LinkIDs = [];

list LinkedList(string Needle) {

   list Needles;
   integer Hay = 1;
   integer Stacks = llGetNumberOfPrims();
   for(; Hay <= Stacks; ++Hay ) if(llGetLinkName(Hay) == Needle) Needles += Hay;
   return Needles;

}

default {

   state_entry() {
       LinkIDs = LinkedList( "EYE" );
       
       integer x = llGetListLength(LinkIDs);
       integer y = 0;
       for ( ; y < x; ++y )
       {
           llSetLinkTextureAnim( llList2Integer(LinkIDs,y), ANIM_ON | LOOP | PING_PONG, ALL_SIDES, 2, 2, 0, 4, 10.0 );
       }
   }

}

</lsl>