Jump to content

Switch between animations by touching a prim (holding a bag)


Makoto Lunasea
 Share

You are about to reply to a thread that has been inactive for 3770 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

 

Hello guys!  :)

My question perhaps might be simple, but I havent been able to find a solution script for my problem.. whether is free or not!

I made a new bag, and I would like to include a script that once you wear the bag, you can click on the bag and switch between a couple of animations.. is that possible?

Let me know if you know a free script or if you know of any marketplace link!

Thank  you so much in advance!!

 

Makoto

Link to comment
Share on other sites

here is just a basic script to switch between animations

 

integer tog;
integer anims;
integer num;
string animation;
default
{
    state_entry()
    { anims = llGetInventoryNumber(INVENTORY_ANIMATION);
    }   
     attach(key id)
    {  if (id)    
       {  llRequestPermissions(id, PERMISSION_TRIGGER_ANIMATION);         
       }
       else
       tog = 0;       
    }
     run_time_permissions(integer perm)
    {
        if (perm & PERMISSION_TRIGGER_ANIMATION)
        {  tog = 1;
          animation = llGetInventoryName(INVENTORY_ANIMATION,0);   // makes the first anim in inventory the default       
          llStartAnimation( animation );            
        }
    }
    touch_start(integer total_number)
    {
      if(tog)
      {  if(animation != "")
         { llStopAnimation(animation);
         }
           num = ++num % anims;            
           animation = llGetInventoryName(INVENTORY_ANIMATION,num);
           llStartAnimation(animation);     
      }
    }
     changed(integer change)
    {  if (change & CHANGED_INVENTORY)         
        { llResetScript();
        }
    }
}

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3770 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...