The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
GetAttached
llGetAttached
Summary
Function: integer llGetAttached( );
Returns the attach_point (an integer) the object is attached to or zero if it is either not attached or is pending detachment.
|
Note: Constants in italic require a viewer compatible with the Project Bento skeleton. |
Examples
<lsl>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);
}
}
}
run_time_permissions(integer a)
{
if(a & PERMISSION_ATTACH)
llDetachFromAvatar();
}
}</lsl>
This snippet will make a prim invisible when attached, but visible when rezzed unattached
<lsl>
on_rez(integer p)
{
// !llGetAttached() has the value 0 when attached, and 1 when unattached
llSetAlpha( !llGetAttached(), ALL_SIDES);
}
</lsl>