Difference between revisions of "LlGetAttached"
Jump to navigation
Jump to search
Void Singer (talk | contribs) m (formatted example) |
Rolig Loon (talk | contribs) m |
||
(17 intermediate revisions by 6 users not shown) | |||
Line 1: | Line 1: | ||
{{LSL_Function | {{LSL_Function | ||
|func_id=224|func_sleep=0.0|func_energy=10.0 | |func_id=224|func_sleep=0.0|func_energy=10.0 | ||
|func=llGetAttached|return_type=integer | |func=llGetAttached|return_type=integer|return_subtype=attach_point | ||
|func_footnote | |func_footnote | ||
|func_desc | |func_desc | ||
| | |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 | ||
|constants={{LSL_Constants_Attachment}} | |constants={{LSL_Constants_Attachment}} | ||
|examples= | |examples= | ||
< | <source lang="lsl2">default | ||
default | |||
{ | { | ||
attach(key id) | attach(key id) | ||
Line 19: | Line 18: | ||
{ | { | ||
llOwnerSay("Please attach me only to the left hand"); | llOwnerSay("Please attach me only to the left hand"); | ||
llRequestPermissions(id, PERMISSION_ATTACH); | |||
} | } | ||
} | } | ||
Line 28: | Line 27: | ||
llDetachFromAvatar(); | llDetachFromAvatar(); | ||
} | } | ||
} | }</source> | ||
</ | This snippet will make a prim invisible when attached, but visible when rezzed unattached | ||
<source lang="lsl2"> | |||
on_rez(integer p) | |||
{ | |||
// !llGetAttached() has the value 0 when attached, and 1 when unattached | |||
llSetAlpha( !llGetAttached(), ALL_SIDES); | |||
} | |||
</source> | |||
|helpers | |helpers | ||
|also_functions={{LSL DefineRow||[[llAttachToAvatar]]}} | |also_functions={{LSL DefineRow||[[llAttachToAvatar]]}} | ||
{{LSL DefineRow||[[llDetachFromAvatar]]}} | {{LSL DefineRow||[[llDetachFromAvatar]]}} | ||
{{LSL DefineRow||[[llGetAttachedList]]}} | |||
{{LSL DefineRow||[[llGetObjectDetails]]|[[OBJECT_ATTACHED_POINT]]}} | |||
|also_events={{LSL DefineRow||[[attach]]}} | |also_events={{LSL DefineRow||[[attach]]}} | ||
|also_tests | |also_tests |
Latest revision as of 08:44, 6 October 2015
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
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();
}
}
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
Events
• | attach |
Functions
• | llAttachToAvatar | |||
• | llDetachFromAvatar | |||
• | llGetAttachedList | |||
• | llGetObjectDetails | – | OBJECT_ATTACHED_POINT |