User:Toady Nakamura/Smile Script

From Second Life Wiki
< User:Toady Nakamura
Revision as of 17:04, 10 March 2012 by Toady Nakamura (talk | contribs) (added script.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<lsl>

// Be Happy ! Put this in a prim & wear it // The system animation "express toothsmile" will make your avatar smile!

default {

   state_entry()
   {   
       llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
       // getting permission here is automatic, because the item is worn
       // triggers run_time_permissions event
   }

   run_time_permissions(integer perm)
   {
       if(perm & PERMISSION_TRIGGER_ANIMATION)
       {
           llSetTimerEvent(5.0);  
          // since permission was granted set a 5 second timer event
       }
   }

   timer()
   {    
       llStartAnimation("express_toothsmile");
       // every five seconds, replay the system animation
   }

   attach(key moo)
   {
       if(moo)
       {  
           llResetScript();
           // when the item is worn, reset the script
       }
   }

}

</lsl>