Advertisement
salahzar

Script Animazione Edmondo novembre 2013

Dec 10th, 2013
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // The most basic of pose scripts
  2.  
  3. // change to the name of animation contained within your sittable object
  4. string pose = "tpose2";
  5.  
  6. // change to x,y,z offset of object center where you want to appear (never all 0)
  7. vector target = <0.0, 0.0, 1.5>;
  8. integer duration=5;
  9. key av;
  10.  
  11. // optional sit text to appear over object
  12. // string text = "T-Pose";
  13.  
  14. startanimation()
  15. {
  16.     llStopAnimation("sit");
  17.     llStartAnimation(pose);
  18.     llSetAlpha(0,ALL_SIDES);
  19.     llSetText("",<1.0,0.0,0.0>,1.0);    
  20. }
  21. stopanimation()
  22. {
  23.    // llSay(0,"stopping");
  24.    if(av!=NULL_KEY){
  25.     llStopAnimation(pose);
  26.     llStartAnimation("stand");
  27. }
  28.     llSetAlpha(1,ALL_SIDES);
  29.     llSetText(pose,<1.0,0.0,0.0>,1.0);
  30.     if(av!=NULL_KEY)llUnSit(av);    
  31. }
  32.  
  33.  
  34. default {
  35.     state_entry()
  36.     {
  37.         llSitTarget(target, ZERO_ROTATION);
  38.         av=NULL_KEY;
  39.        
  40.         pose=llGetInventoryName(INVENTORY_ANIMATION,0);
  41.         llSetSitText(pose);
  42.         stopanimation();
  43.  
  44.       }
  45.  
  46.  
  47.     changed(integer change)
  48.     {
  49.         if (change & CHANGED_LINK)
  50.         {
  51.             if (llAvatarOnSitTarget() != NULL_KEY)
  52.             {
  53.                 av=llAvatarOnSitTarget();
  54.                 llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION);
  55.                
  56.             }
  57.             else
  58.             {
  59.                stopanimation();
  60.                av=NULL_KEY;
  61.             }
  62.         }
  63.         if(change & CHANGED_INVENTORY)
  64.         {
  65.             llResetScript();
  66.            
  67.         }
  68.     }
  69.     run_time_permissions(integer perm)                                  
  70.     {
  71.         if (perm & PERMISSION_TRIGGER_ANIMATION)
  72.         {
  73.             startanimation();
  74.             // llSay(PUBLIC_CHANNEL, "Animation will end in 5.0 seconds.");
  75.  
  76.             //llSetTimerEvent(duration);
  77.         }
  78.     }
  79.     timer()
  80.     {
  81.         llSetTimerEvent(0);
  82.         stopanimation();
  83.     }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement