Difference between revisions of "User:Toady Nakamura/Smile Script"

From Second Life Wiki
Jump to navigation Jump to search
m (minor edit & watch)
m
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
For humanoid avatars... this script in a prim & worn will make your avatar smile!!
For humanoid avatars... this script in a prim & worn will make your avatar smile!!
Found in a 2008 freebie, modified slightly by [[User:Toady Nakamura|Toady Nakamura]]
*Found in a 2008 freebie, modified slightly by [[User:Toady Nakamura|Toady Nakamura]]
*There is a version in the LSL wiki > examples, but it's not annotated as to HOW it works
* See [https://wiki.secondlife.com/wiki/Internal_Animations here for a list of Internal Animations]


<lsl>
<source lang="lsl2">
 
 
default
default
{
{
Line 40: Line 39:
}
}


</lsl>
</source>
 
 
Visit my LSL wiki page for my library of simple scripts !  [[User:Toady Nakamura|Toady Nakamura]]

Latest revision as of 14:03, 11 March 2016

For humanoid avatars... this script in a prim & worn will make your avatar smile!!

default
{
    state_entry()
    {   
        llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
        // getting permission here is automatic, because the item is worn
        // triggers run_time_permissions event
    }
 
    run_time_permissions(integer perm)
    {
        if(perm & PERMISSION_TRIGGER_ANIMATION)
        {
            llSetTimerEvent(5.0);  
           // since permission was granted set a 5 second timer event
        }
    }
 
    timer()
    {    
        llStartAnimation("express_toothsmile");
        // every five seconds, replay the system animation
    }
 
    attach(key moo)
    {
        if(moo)
        {  
            llResetScript();
            // when the item is worn, reset the script
        }
    }
}


Visit my LSL wiki page for my library of simple scripts ! Toady Nakamura