User:Toady Nakamura/Hold Teddy Script

From Second Life Wiki
< User:Toady Nakamura
Revision as of 17:30, 10 March 2012 by Toady Nakamura (talk | contribs) (put hold teddy script here)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

<lsl>

// This script is useful for things like holding teddybears or sandwiches. // You need an animation to put in the same prim. Here I named the animation "Hold" // You have to change the animation name to the animation you include in the prim // with the script.

string anim ="Hold";

default {

   attach(key wearer)
   {
   if(wearer == NULL_KEY)
   {
         llStopAnimation(anim);
         llSetTimerEvent(0);
       }
       else
       {
        llRequestPermissions(wearer,PERMISSION_TRIGGER_ANIMATION);
   }

}

  run_time_permissions(integer permissions)
   {
       if (PERMISSION_TRIGGER_ANIMATION & permissions)
       {
       llStartAnimation(anim);
       
       llSetTimerEvent(15);
       }
   }
  timer()
  {
       llStartAnimation(anim);
       }    
     } 

}

</lsl>