From Second Life Wiki
Function: llAttachToAvatar( integer attach_point );
Attaches the object to the avatar who has granted permission to the script. The object is taken into the users inventory and attached to attach_point.
|| ATTACH_* constant or valid value (see the tables below)
To run this function the script must request the PERMISSION_ATTACH permission with llRequestPermissions and it must be granted by the owner.
If attach_point is zero, then the object attaches to the attach point it was most recently attached to.
- Do not depend upon the auto-grant status of permissions. Always use the run_time_permissions event.
- If the script lacks the permission PERMISSION_ATTACH, the script will shout an error on DEBUG_CHANNEL and the operation fails (but the script continues to run).
- If PERMISSION_ATTACH is granted by anyone other than the owner, then when the function is called an error will be shouted on DEBUG_CHANNEL.
- Once the PERMISSION_ATTACH permission is granted there is no way to revoke it except from inside the script (for example, with a new llRequestPermissions call). The script will only lose the permission if it is reset or the object is derezzed (deleted, detached, or taken).
- Attach points can be occupied by multiple attachments.
- This was not always the case, previously if attach_point was occupied, the existing object was detached and the new attachment took it's place.
- Objects attached to the head (and any attachment position within the head) will not be visible in First Person view (aka Mouselook) if "show attachments in mouselook" is disable.
- If attach_point is zero but the object was never previously attached, it defaults to the right hand (ATTACH_RHAND).
- If the object is already attached the function fails silently, regardless if the attach_point is a different attach point. -- SCR-137
Important Issues ~ All Issues ~ Search JIRA for related Bugs
|| [A, C]
|| llAttachToAvatar can cause a stack/heap collision in certain circumstances
|| [A, C]
|| Add companion command to llAttachToAvatar() to allow attaching multiple items in same attachment point