Advertisement
Guest User

Untitled

a guest
Nov 15th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. list animations = ["solo rfb-6 sit edge legs crossed","second animation"];
  2. integer animation_index = 0;
  3. string curr_animation;
  4.  
  5. default
  6. {
  7.     state_entry()
  8.     {
  9.         llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
  10.     }
  11.    
  12.     on_rez(integer shellseat)
  13.     {
  14.         llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);      
  15.     }
  16.    
  17.     touch_end(integer num)
  18.     {
  19.         animation_index++;
  20.         if(animation_index >= llGetListLength(animations)) animation_index = 0; //roll back to 0 at the end of the list;
  21.     }
  22.  
  23.     run_time_permissions(integer perm)
  24.     {
  25.         if(perm)
  26.         {
  27.             if(curr_animation) llStopAnimation(curr_animation);
  28.             curr_animation = llList2String(animations, animation_index);
  29.             llStartAnimation(animation);    
  30.             vector myPosition = llGetPos();
  31.             llSetHoverHeight(myPosition.z - llGround(ZERO_VECTOR) + .74, FALSE, 1.0);          
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement