Difference between revisions of "LlGetAttached"
Jump to navigation
Jump to search
Omei Qunhua (talk | contribs) (Add a code snippet) |
(Updated description to match actual behavior seen in sim (we don't want to change the existing behavior for fear of breaking it)) |
||
Line 4: | Line 4: | ||
|func_footnote | |func_footnote | ||
|func_desc | |func_desc | ||
|Return_text=the object is attached to or {{HoverText|zero|0}} if it is not attached. | |Return_text=the object is attached to or {{HoverText|zero|0}} if it is either not attached or is pending detachment. | ||
|spec | |spec | ||
|caveats | |caveats |
Revision as of 11:09, 16 October 2014
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: integer llGetAttached( );224 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
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. |
|
|
Caveats
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>
See Also
Events
• | attach |
Functions
• | llAttachToAvatar | |||
• | llDetachFromAvatar | |||
• | llGetObjectDetails | – | OBJECT_ATTACHED_POINT |