default
{
attach(key on)
{
if (on != NULL_KEY)
{
integer perm = llGetPermissions();
if (!(perm & PERMISSION_TRIGGER_ANIMATION))
{
llRequestPermissions(on, PERMISSION_TRIGGER_ANIMATION);
}
else
{
llSetTimerEvent(0.5);
}
}
}
run_time_permissions(integer perm)
{
if (perm & PERMISSION_TRIGGER_ANIMATION)
{
llSetTimerEvent(0.5);
}
}
timer()
{
llStopAnimation("express_open_mouth");
llStartAnimation("express_open_mouth");
}
}
The attach method is an event handler that is triggered when the scripted item is attached to or detached from an avatar. The key parameter is the key of the avatar during attachment, or NULL_KEY on detachment.
As a complete aside, I had to use the <pre> and </pre> HTML tags in order to get the code sample up there to show up properly indented. I'm a bit of an HTML newbie as well...