Difference between revisions of "Be happy"
Jump to navigation
Jump to search
Emmas Seetan (talk | contribs) |
m (Replaced <source> with <syntaxhighlight>) |
||
(7 intermediate revisions by 5 users not shown) | |||
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. | ||
//be happy | <syntaxhighlight lang="lsl2"> | ||
// be happy | |||
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 perm) | |||
{ | |||
if(perm & PERMISSION_TRIGGER_ANIMATION) | |||
llSetTimerEvent(5.0); | |||
} | |||
timer() | |||
{ | { | ||
llStartAnimation("express_toothsmile"); | |||
} | } | ||
} | |||
</syntaxhighlight> | |||
{{LSLC|Examples|Be happy}} | |||
Latest revision as of 15:55, 3 February 2023
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");
}
}