Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string lastAnim;
- default
- {
- on_rez(integer start)
- {
- llResetScript();
- }
- state_entry()
- {
- llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
- }
- run_time_permissions(integer perm)
- {
- if(perm & PERMISSION_TRIGGER_ANIMATION)
- {
- state AO;
- }
- }
- }
- state AO
- {
- on_rez(integer start)
- {
- llResetScript();
- }
- state_entry()
- {
- list anims = llGetAnimationList(llGetOwner());
- integer i;
- for (i=0; i<llGetListLength(anims); i++)
- {
- llStopAnimation(llList2String(anims,i));
- }
- llMonitorAnimationState(llGetOwner()); // Starts animation_state() callback function on animation state changes on llGetOwner()
- }
- animation_state(key id, string anim)
- {
- llStartAnimation(anim);
- llStopAnimation(lastAnim);
- lastAnim = anim;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement