Be happy

From Second Life Wiki
Revision as of 16:55, 3 February 2023 by Gwyneth Llewelyn (talk | contribs) (Replaced <source> with <syntaxhighlight>)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Put this script in an attachment to make your avatar smile.

//  be happy

default
{
    attach(key attached)
    {
        if (attached)
            llResetScript();
    //  else
    //      has been detached
    }

    state_entry()
    {
        key owner = llGetOwner();

        llRequestPermissions(owner, PERMISSION_TRIGGER_ANIMATION);
    }

    run_time_permissions(integer perm)
    {
        if(perm & PERMISSION_TRIGGER_ANIMATION)
            llSetTimerEvent(5.0);
    }

    timer()
    {
        llStartAnimation("express_toothsmile");
    }
}