# llGetAttachedListFiltered

*LSL function*

```lsl
list list llGetAttachedListFiltered(key avatar, list options);
```

- `key avatar`: UUID of the avatar in the same region.
- `list options`: A list of options to filter the returned attachments.

- Returns: `list`
- Energy: 10

If avatar is a child agent, \["NOT ON REGION"\] is returned.

If avatar is not a main agent and not a child agent or not an agent at all, \["NOT FOUND"\] is returned.

Returns a [list](https://wiki.secondlife.com/wiki/list) of object keys corresponding to public attachments worn by an **avatar** in the order they were attached.

```lsl title="How to use" frame="terminal"
list result = llGetAttachedListFiltered(NULL_KEY, []);
```

## Specification

Constant group [AttachedListFilterParam](/constants/groups/AttachedListFilterParam/):

```lsl
FILTER_FLAGS = 2
FILTER_INCLUDE = 1
```

Returns a list of attachments on the avatar.

By default this function will return all attachments on all attachment points. A script may specify multiple [FILTER_INCLUDE](/constants/FILTER_INCLUDE/) options which will limit the returned attachments to only those listed.

If the script specifies the [FILTER_FLAGS](/constants/FILTER_FLAGS/) option with [FILTER_FLAG_HUDS](/constants/FILTER_FLAG_HUDS/) this function will include any attached HUDs if the following conditions are met:

- The script must be compiled with an experience
- The experience must be active in the region
- The avatar must have accepted the experience
- The HUD must include at least one script that was also compiled with the same experience.

| Constant | Type | Value | Description |
| --- | --- | --- | --- |
| [FILTER_INCLUDE](/constants/FILTER_INCLUDE/) | integer | `1` |  |
| [FILTER_FLAGS](/constants/FILTER_FLAGS/) | integer | `2` |  |
| [FILTER_FLAG_HUDS](/constants/FILTER_FLAG_HUDS/) | integer | `0x0001` |  |

<table>
	<tr>
		<th colspan="2">Parameter</th>
		<th colspan="2">Format</th>
		<th colspan="6">Description</th>
	</tr>
	<tr>
		<td colspan="2">\[ [FILTER_INCLUDE](/constants/FILTER_INCLUDE/), [integer](https://wiki.secondlife.com/wiki/integer) **attachment_point** \]</td>
		<td colspan="6">Include attachments on the specified attachment point in the returned results.<br /> This parameter may occur multiple times. If it is omitted the function returns attachments on all attachment points.</td>
	</tr>
	<tr>
		<td colspan="2">\[ [FILTER_FLAGS](/constants/FILTER_FLAGS/), [integer](https://wiki.secondlife.com/wiki/integer) **flags** \]</td>
		<td colspan="6">

			Flags to control filter behavior.

			<table>
				<tr>
					<th colspan="2">Parameter</th>
					<th colspan="6">Description</th>
				</tr>
				<tr>
					<td colspan="6">Include HUDs in the returned result.</td>
				</tr>
			</table>

		</td>
	</tr>
</table>

:::note
Constants in *italic* require a viewer compatible with the [Project Bento](https://wiki.secondlife.com/wiki/Project_Bento_Skeleton_Guide) skeleton.
:::

<table>
	<tr>
		<td>

			****Body****

			| Constant | # | Name | Comment |
			| --- | --- | --- | --- |
			| [ATTACH_HEAD](/constants/ATTACH_HEAD/) | 2 | Skull | head |
			| [ATTACH_NOSE](/constants/ATTACH_NOSE/) | 17 | Nose | nose |
			| [ATTACH_MOUTH](/constants/ATTACH_MOUTH/) | 11 | Mouth | mouth |
			| [*ATTACH_FACE_TONGUE*](/constants/ATTACH_FACE_TONGUE/) | 52 | Tongue | tongue |
			| [ATTACH_CHIN](/constants/ATTACH_CHIN/) | 12 | Chin | chin |
			| [*ATTACH_FACE_JAW*](/constants/ATTACH_FACE_JAW/) | 47 | Jaw | jaw |
			| [ATTACH_LEAR](/constants/ATTACH_LEAR/) | 13 | Left Ear | left ear |
			| [ATTACH_REAR](/constants/ATTACH_REAR/) | 14 | Right Ear | right ear |
			| [*ATTACH_FACE_LEAR*](/constants/ATTACH_FACE_LEAR/) | 48 | Alt Left Ear | left ear (extended) |
			| [*ATTACH_FACE_REAR*](/constants/ATTACH_FACE_REAR/) | 49 | Alt Right Ear | right ear (extended) |
			| [ATTACH_LEYE](/constants/ATTACH_LEYE/) | 15 | Left Eye | left eye |
			| [ATTACH_REYE](/constants/ATTACH_REYE/) | 16 | Right Eye | right eye |
			| [*ATTACH_FACE_LEYE*](/constants/ATTACH_FACE_LEYE/) | 50 | Alt Left Eye | left eye (extended) |
			| [*ATTACH_FACE_REYE*](/constants/ATTACH_FACE_REYE/) | 51 | Alt Right Eye | right eye (extended) |
			| [ATTACH_NECK](/constants/ATTACH_NECK/) | 39 | Neck | neck |
			| [ATTACH_LSHOULDER](/constants/ATTACH_LSHOULDER/) | 3 | Left Shoulder | left shoulder |
			| [ATTACH_RSHOULDER](/constants/ATTACH_RSHOULDER/) | 4 | Right Shoulder | right shoulder |
			| [ATTACH_LUARM](/constants/ATTACH_LUARM/) | 20 | L Upper Arm | left upper arm |
			| [ATTACH_RUARM](/constants/ATTACH_RUARM/) | 18 | R Upper Arm | right upper arm |
			| [ATTACH_LLARM](/constants/ATTACH_LLARM/) | 21 | L Lower Arm | left lower arm |
			| [ATTACH_RLARM](/constants/ATTACH_RLARM/) | 19 | R Lower Arm | right lower arm |
			| [ATTACH_LHAND](/constants/ATTACH_LHAND/) | 5 | Left Hand | left hand |
			| [ATTACH_RHAND](/constants/ATTACH_RHAND/) | 6 | Right Hand | right hand |
			| [*ATTACH_LHAND_RING1*](/constants/ATTACH_LHAND_RING1/) | 41 | Left Ring Finger | left ring finger |
			| [*ATTACH_RHAND_RING1*](/constants/ATTACH_RHAND_RING1/) | 42 | Right Ring Finger | right ring finger |
			| [*ATTACH_LWING*](/constants/ATTACH_LWING/) | 45 | Left Wing | left wing |
			| [*ATTACH_RWING*](/constants/ATTACH_RWING/) | 46 | Right Wing | right wing |
			| [ATTACH_CHEST](/constants/ATTACH_CHEST/) | 1 | Chest | chest/sternum |
			| [ATTACH_LEFT_PEC](/constants/ATTACH_LEFT_PEC/) | 29 | Left Pec | left pectoral |
			| [ATTACH_RIGHT_PEC](/constants/ATTACH_RIGHT_PEC/) | 30 | Right Pec | right pectoral |
			| [ATTACH_BELLY](/constants/ATTACH_BELLY/) | 28 | Stomach | belly/stomach/tummy |
			| [ATTACH_BACK](/constants/ATTACH_BACK/) | 9 | Spine | back |
			| [*ATTACH_TAIL_BASE*](/constants/ATTACH_TAIL_BASE/) | 43 | Tail Base | tail base |
			| [*ATTACH_TAIL_TIP*](/constants/ATTACH_TAIL_TIP/) | 44 | Tail Tip | tail tip |
			| [ATTACH_AVATAR_CENTER](/constants/ATTACH_AVATAR_CENTER/) | 40 | Avatar Center | avatar center/root |
			| [ATTACH_PELVIS](/constants/ATTACH_PELVIS/) | 10 | Pelvis | pelvis |
			| [*ATTACH_GROIN*](/constants/ATTACH_GROIN/) | 53 | Groin | groin |
			| [ATTACH_LHIP](/constants/ATTACH_LHIP/) | 25 | Left Hip | left hip |
			| [ATTACH_RHIP](/constants/ATTACH_RHIP/) | 22 | Right Hip | right hip |
			| [ATTACH_LULEG](/constants/ATTACH_LULEG/) | 26 | L Upper Leg | left upper leg |
			| [ATTACH_RULEG](/constants/ATTACH_RULEG/) | 23 | R Upper Leg | right upper leg |
			| [ATTACH_RLLEG](/constants/ATTACH_RLLEG/) | 24 | R Lower Leg | right lower leg |
			| [ATTACH_LLLEG](/constants/ATTACH_LLLEG/) | 27 | L Lower Leg | left lower leg |
			| [ATTACH_LFOOT](/constants/ATTACH_LFOOT/) | 7 | Left Foot | left foot |
			| [ATTACH_RFOOT](/constants/ATTACH_RFOOT/) | 8 | Right Foot | right foot |
			| [*ATTACH_HIND_LFOOT*](/constants/ATTACH_HIND_LFOOT/) | 54 | Left Hind Foot | left hind foot |
			| [*ATTACH_HIND_RFOOT*](/constants/ATTACH_HIND_RFOOT/) | 55 | Right Hind Foot | right hind foot |

		</td>
		<td></td>
		<td>

			<table>
				<caption>**HUD**</caption>
				<tr>
					<th colspan="2">Constant</th>
					<th>Comment</th>
				</tr>
				<tr>
					<td>[ATTACH_HUD_CENTER_2](/constants/ATTACH_HUD_CENTER_2/)</td>
					<td>31</td>
					<td>HUD Center 2</td>
				</tr>
				<tr>
					<td>[ATTACH_HUD_TOP_RIGHT](/constants/ATTACH_HUD_TOP_RIGHT/)</td>
					<td>32</td>
					<td>HUD Top Right</td>
				</tr>
				<tr>
					<td>[ATTACH_HUD_TOP_CENTER](/constants/ATTACH_HUD_TOP_CENTER/)</td>
					<td>33</td>
					<td>HUD Top</td>
				</tr>
				<tr>
					<td>[ATTACH_HUD_TOP_LEFT](/constants/ATTACH_HUD_TOP_LEFT/)</td>
					<td>34</td>
					<td>HUD Top Left</td>
				</tr>
				<tr>
					<td>[ATTACH_HUD_CENTER_1](/constants/ATTACH_HUD_CENTER_1/)</td>
					<td>35</td>
					<td>HUD Center</td>
				</tr>
				<tr>
					<td>[ATTACH_HUD_BOTTOM_LEFT](/constants/ATTACH_HUD_BOTTOM_LEFT/)</td>
					<td>36</td>
					<td>HUD Bottom Left</td>
				</tr>
				<tr>
					<td>[ATTACH_HUD_BOTTOM](/constants/ATTACH_HUD_BOTTOM/)</td>
					<td>37</td>
					<td>HUD Bottom</td>
				</tr>
				<tr>
					<td>[ATTACH_HUD_BOTTOM_RIGHT](/constants/ATTACH_HUD_BOTTOM_RIGHT/)</td>
					<td>38</td>
					<td>HUD Bottom Right</td>
				</tr>
			</table>

			<table>
				<caption>**Special**</caption>
				<tr>
					<th colspan="2">Constant</th>
					<th>Comment</th>
				</tr>
				<tr>
					<td>[ATTACH_ANY_HUD](/constants/ATTACH_ANY_HUD/)</td>
					<td>-1</td>
					<td>A special constant representing all HUD attachment points when filtering.</td>
				</tr>
			</table>

		</td>
	</tr>
</table>

## Caveats

When an avatar first arrives in a region, there is a brief period when their attachments are not yet fully rezzed or added. During this time, those attachments will not appear in the results.

## Examples

<details open>
<summary>Example 1</summary>

```lsl collapse={8-19}
default
{
    state_entry()
    {
        list attachments = llGetAttachedListFiltered(llGetOwner(), [FILTER_INCLUDE, ATTACH_RHAND]);

        // Object UUIDs:
        llOwnerSay(llList2CSV(attachments));

        // Object names:
        integer i;
        integer max = llGetListLength(attachments);
        for (i = 0; i < max; ++i)
        {
            string name = llList2String(attachments, i);
            llOwnerSay(llKey2Name(name));
        }
    }
}
```

</details>

## See also

### Functions

- [llGetAttachedList](/functions/llGetAttachedList/)
- [llGetAttached](/functions/llGetAttached/)
- [llGetAttachedList](/functions/llGetAttachedList/)
- [llAttachToAvatar](/functions/llAttachToAvatar/)
- [llDetachFromAvatar](/functions/llDetachFromAvatar/)
- [llAttachToAvatar](/functions/llAttachToAvatar/)
- [llGetObjectDetails](/functions/llGetObjectDetails/) — [OBJECT_ATTACHED_POINT](/constants/OBJECT_ATTACHED_POINT/)

### Events

- [attach](/events/attach/)

---

*Source: [LlGetAttachedListFiltered](https://wiki.secondlife.com/wiki/LlGetAttachedListFiltered) on the Second Life Wiki. Content from the Second Life Wiki articles LlGetAttachedListFiltered (revision 1217859, 2025-01-09), Template:LSL Constants Attachment (revision 1217598, 2024-11-06), Template:LSL Constants Attachment Filter (revision 1217603, 2024-11-06) and Template:LSL Function/avatar (revision 1179236, 2013-06-15), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llGetAttachedListFiltered/
