From Second Life Wiki
Template:Needs Translation/LSL/de
Template:Needs Translation/LSL/es
Template:Needs Translation/LSL/el
Template:Needs Translation/LSL/he
Template:Needs Translation/LSL/it
Template:Needs Translation/LSL/ko
Template:Needs Translation/LSL/nl
Template:Needs Translation/LSL/hu
Template:Needs Translation/LSL/no
Template:Needs Translation/LSL/da
Template:Needs Translation/LSL/sv
Template:Needs Translation/LSL/tr
Template:Needs Translation/LSL/pl
Template:Needs Translation/LSL/pt
Template:Needs Translation/LSL/ru
Template:Needs Translation/LSL/uk
Template:Needs Translation/LSL/zh-Hans
Template:Needs Translation/LSL/zh-Hant
/LSL
AttachToAvatar
llAttachToAvatar
Summary
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.
| • integer
| attach_point
| –
| ATTACH_* constant or valid value (see the tables below)
|
|
Requires the PERMISSION_ATTACH permission, granted by the owner, to run.
If attach_point is zero, then the object attaches to the attach point it was most recently attached to.
Caveats
- 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). Otherwise, the script will only lose the permission if it is reset or the object is derezzed (deleted, detached, or taken).
- If attach_point is occupied, the existing object will be detached and the new attachment will take it's place. Two objects cannot be attached to the same attachment point at the same time.
- 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.
Important Issues
~
Search JIRA for related Bugs
|
| SVC-890
| [c]
|
| llAttachToAvatar can cause a stack/heap collision in certain circumstances
|
See Also
Events
Functions
Articles