Don't click here unless you want to be banned.

LSL Wiki : ExampleAnimationBasic

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org
// Basic Animation / Attachment 1.0
// Catherine Omega Heavy Industries

string gAnimName = "sit"; // what animation to play?

default
{
    state_entry()
    {
        llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); // ask the owner for permission to trigger animations
        llStartAnimation(gAnimName); // automatically trigger animation.
    }
    
    on_rez(integer param)
    {
        llResetScript(); // reset the script as soon as it starts.
    }
    
    attach(key id)
    {
        integer perm = llGetPermissions();
        
        if (id != NULL_KEY) // make sure we're actually attached.
        {        
            if (! (perm & PERMISSION_TRIGGER_ANIMATION)) // remember to use bitwise operators!
            {
                llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION); // request permissions from the owner.
            }                
        }
        else
        {
            if (perm & PERMISSION_TRIGGER_ANIMATION)
            {
                llStopAnimation(gAnimName); // stop the animation
            }
        }
    }
}

For a more in-depth animation script, see Xylor's ExampleAnimationScript.


Examples / Permissions
There is one comment on this page. [Display comments/form]