llGetAttached
function
Function syntax
integer llGetAttached();- Returns
integer- Energy
- 10
Returns the integer attachment point (an ATTACH_* constant) that the object is attached to, or 0 if it is unattached or pending detachment.
integer result = llGetAttached();Specification
Section titled “Specification”Body
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Examples
Section titled “Examples”Example 1
default{ attach(key id) { if(id)//it's attached { if(llGetAttached() != ATTACH_LHAND) { llOwnerSay("Please attach me only to the left hand"); llRequestPermissions(id, PERMISSION_ATTACH); } } }6 collapsed lines
run_time_permissions(integer a) { if(a & PERMISSION_ATTACH) llDetachFromAvatar(); }}This snippet will make a prim invisible when attached, but visible when rezzed unattached
on_rez(integer p) { // !llGetAttached() has the value 0 when attached, and 1 when unattached llSetAlpha( !llGetAttached(), ALL_SIDES); }See also
Section titled “See also”Functions
Section titled “Functions”llAttachToAvatarllDetachFromAvatarllGetAttachedListllGetAttachedListFilteredllGetObjectDetails—OBJECT_ATTACHED_POINT
Events
Section titled “Events”Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.