Advertisement
Guest User

Untitled

a guest
Jul 11th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Poseball & Furniture script
  2. // by Daemonika Nightfire (2009/2010)
  3. // NO License! that script is free for all.
  4.  
  5. // why poseball and Furniture?...
  6. // ...just delete all funktions with show/hide and it works for Furniture too.
  7. // llSitTarget(<-0.1,0.1,-0.43>... set the Avatar Position to the prim in meters,
  8. // ...,llEuler2Rot(<00,-90,-90>*DEG_TO_RAD)); set the angle Rotation from the Avatar in 3 axis <x,y,z>.
  9.  
  10. // why no script error at crashing Avatar?...
  11. // ...llKey2Name ask for sitting Avatarname...
  12. // ...is there no name, so nobody there for stop animation and the script will show the Ball only.
  13.  integer test=1;
  14. string anim;
  15.  
  16. integer sitting;
  17.  
  18. anim1()
  19. {
  20.   llStartAnimation("male-sit-2-r");
  21.         llSitTarget(<-0.1,0.1,-0.43>,llEuler2Rot(<00,-90,-90>*DEG_TO_RAD));  
  22.  
  23. }
  24. anim2()
  25.    {
  26.       llStartAnimation("Cute");
  27.         llSitTarget(<-0.1,0.1,-0.43>,llEuler2Rot(<00,-90,-90>*DEG_TO_RAD));      
  28. }
  29.  
  30. anim3()
  31.    {
  32.       llStartAnimation("propped-sit-m-2");
  33.         llSitTarget(<-0.1,0.1,-0.43>,llEuler2Rot(<00,-90,-90>*DEG_TO_RAD));      
  34. }
  35. show()
  36. {
  37.     llSetPrimitiveParams([PRIM_TEXT,"SIT HERE",<0.9,0.6,0.2>,1.0, PRIM_COLOR, ALL_SIDES,<1,1,1>,1.0]);
  38. }
  39. hide()
  40. {
  41.     llSetPrimitiveParams([PRIM_TEXT,"",ZERO_VECTOR,0.0, PRIM_COLOR, ALL_SIDES,ZERO_VECTOR,0.0]);
  42. }
  43. default
  44. {
  45.     state_entry()
  46.     {
  47.         show();
  48.         sitting = 0;
  49.        
  50.  
  51.    
  52.    
  53.  
  54.     }
  55.    
  56.    
  57.          run_time_permissions(integer perm)
  58.     {    
  59.         if (perm & PERMISSION_TRIGGER_ANIMATION)
  60.         {
  61.             sitting = 1;
  62.             llStopAnimation("sit_generic");
  63.             llStopAnimation("sit");
  64.         if ( test ==1)
  65.             {
  66.             hide();
  67.     anim1();
  68.     anim= "Cute";
  69.         test =2;
  70.     }
  71.         if (test ==2)
  72.            { hide();
  73.             anim2();
  74.             anim= "male-sit-2-r";
  75.            test =3;
  76.         }
  77.             else if (test==3)
  78.             {
  79.         hide();
  80.     anim3();
  81.         anim = "propped-sit-m-2";
  82.            test=1;
  83.            
  84.     }
  85.         }
  86.     }    
  87.        
  88.    touch_start(integer x)
  89.     {
  90.        
  91.         key avatar = llAvatarOnSitTarget();
  92.             if (llKey2Name(avatar) != "")
  93.    {
  94.           if (test ==1)
  95.         {
  96.     anim1();
  97.         test = 2;
  98.    
  99. }
  100.  else if ( test == 2)
  101. {
  102.   anim2();
  103.    test =3;
  104.         }
  105.      
  106.    else  if (test==3)
  107.         {
  108.         anim3();
  109.     test=1;
  110.     return;
  111. }
  112.        
  113.     }
  114. }
  115.    
  116.        
  117.        
  118.     changed(integer change)
  119.     {
  120.         if (change & CHANGED_LINK)
  121.         {
  122.             key avatar = llAvatarOnSitTarget();
  123.             if (llKey2Name(avatar) != "")
  124.             {
  125.                 llRequestPermissions(avatar, PERMISSION_TRIGGER_ANIMATION);
  126.             }
  127.             else
  128.             {
  129.                 show();
  130.                 if ((llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) && sitting && llKey2Name(avatar) != "")
  131.                 {
  132.                     llStopAnimation(anim);
  133.                 }
  134.                 sitting = 0;
  135.             }
  136.         }
  137.         if (change & CHANGED_OWNER + CHANGED_REGION_START + CHANGED_INVENTORY)
  138.         {
  139.             llResetScript();
  140.         }
  141.     }
  142.     on_rez(integer start_param)
  143.     {
  144.         llResetScript();
  145.     }
  146. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement