This event handler
is triggered whenever the object
is attached (which makes it an attachment
) or detached from the avatar
. If it is attached, id
contains the key
of the avatar it is attached to, otherwise id
if (attached != NULL_KEY) // object has been //attached//
llWhisper( 0, "I'm stuck on you, " + llKey2Name(attached) );
else // object has been detached
llWhisper( 0, "Why hast thou forsaken me?" );
Note: if both on_rez
are used, on_rez
be triggered first.
Note: when the object is detached to inventory, it will be given a limited amount of CPU cycles to run its attach
event before it is derezed. There is no guarantee that all of the code within the attach
event will complete before the derez occurs. In particular, expensive operations such as llSetPos
may cause the script to be descheduled early, preventing timely execution of subsequent code.
Does not fire in child prims, only in root of linked objects.
Use the llAttachToAvatar
functions to play with attachments.