Guest User

Untitled

a guest
Apr 18th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ~pose1
  2.  
  3. //MLP MULTI-LOVE-POSE V1.2 - Copyright (c) 2006, by Miffy Fluffy (BSD License)
  4. integer ch = 0;  //pose1: ch=0  //pose2: ch=1
  5. string animation = "stand";
  6. key avatar;
  7.  
  8. stopAnim() {
  9.     list l=llGetAnimationList(llGetPermissionsKey());
  10.     integer i;
  11.     for (i;i<llGetListLength(l);++i) llStopAnimation(llList2String(l,i));
  12. }
  13.  
  14. default {
  15.    state_entry() {
  16.         ch += (integer)("0x"+llGetSubString((string)llGetKey(),-4,-1)); //fixed channel for prim
  17.         llListen(ch+4,"",NULL_KEY,"");
  18.     }
  19.     link_message(integer from, integer num, string an, key id) {        //an animation is set
  20.         if (an == "PRIMTOUCH") {
  21.             return;
  22.         }
  23.         if(num != ch) return;
  24.         if (llGetPermissionsKey() == avatar && avatar != NULL_KEY) {    //permissions
  25.             llStopAnimation(animation);
  26.             llStartAnimation(an);
  27.         }
  28.         animation=an;
  29.     }
  30.     listen(integer channel, string name, key id, string str) {          
  31.         if (str == "ALIVE" || str == "DIE") {
  32.             llMessageLinked(LINK_THIS,2,str,"");                        //send msg from ball to menu
  33.             return;
  34.         }
  35.         avatar = str;                                                   //avatar sits or stands up
  36.         if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) {        //permissions ok
  37.             stopAnim();
  38.             if (llGetPermissionsKey() == avatar) { llStartAnimation(animation); return; }   //if avatar is the same: animate
  39.         }
  40.         if (avatar != NULL_KEY) llRequestPermissions(avatar,PERMISSION_TRIGGER_ANIMATION);  //ask permission from new avatar
  41.     }
  42.     run_time_permissions(integer perm) {
  43.         if (perm & PERMISSION_TRIGGER_ANIMATION && llGetPermissionsKey() == avatar) {   //avatar gave permission
  44.             stopAnim();
  45.             llStartAnimation(animation);
  46.         }
  47.     }
  48. }
Add Comment
Please, Sign In to add comment