Difference between revisions of "Be happy"
Jump to navigation
Jump to search
m (cat-fu) |
Kireji Haiku (talk | contribs) m (a few minor readability improvements) |
||
Line 1: | Line 1: | ||
Put this script in an attachment to make your avatar smile. | Put this script in an attachment to make your avatar smile. | ||
<lsl>//be happy | <lsl> | ||
// be happy | |||
default | default | ||
{ | { | ||
attach(key attached) | |||
{ | |||
if (attached) | |||
llResetScript(); | |||
// else | |||
// has been detached | |||
} | |||
state_entry() | state_entry() | ||
{ | { | ||
key owner = llGetOwner(); | |||
llRequestPermissions(owner, PERMISSION_TRIGGER_ANIMATION); | |||
} | } | ||
run_time_permissions(integer | run_time_permissions(integer perm) | ||
{ | { | ||
if( | if(perm & PERMISSION_TRIGGER_ANIMATION) | ||
llSetTimerEvent(5.0); | llSetTimerEvent(5.0); | ||
} | } | ||
Line 22: | Line 31: | ||
llStartAnimation("express_toothsmile"); | llStartAnimation("express_toothsmile"); | ||
} | } | ||
} | |||
</lsl> | |||
{{LSLC|Examples|Be happy}} | {{LSLC|Examples|Be happy}} |
Revision as of 01:03, 21 October 2012
Put this script in an attachment to make your avatar smile.
<lsl> // 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"); }
} </lsl>