Skip to content
lsl.devlsl.devLSL Dev

llGetAttachedListFiltered

function
Function syntax
list llGetAttachedListFiltered(
  1. key avatar,// UUID of the avatar in the same region.
  2. 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 of object keys corresponding to public attachments worn by an avatar in the order they were attached.

How to use
list result = llGetAttachedListFiltered(NULL_KEY, []);
From the LSL definitions: AttachedListFilterParam (rule, then its arguments)
FILTER_FLAGS  // Flags used to control which attachments are returned.FILTER_INCLUDE  // Filter parameter used to include a specific attachment point.

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 options which will limit the returned attachments to only those listed.

If the script specifies the FILTER_FLAGS option with 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.
ConstantTypeValueDescription
FILTER_INCLUDEinteger1
FILTER_FLAGSinteger2
FILTER_FLAG_HUDSinteger0x0001
ParameterFormatDescription
[ FILTER_INCLUDE, integer attachment_point ]Include attachments on the specified attachment point in the returned results.
This parameter may occur multiple times. If it is omitted the function returns attachments on all attachment points.
[ FILTER_FLAGS, integer flags ]

Flags to control filter behavior.

ParameterDescription
Include HUDs in the returned result.

Body

Constant#NameComment
ATTACH_HEAD2Skullhead
ATTACH_NOSE17Nosenose
ATTACH_MOUTH11Mouthmouth
ATTACH_FACE_TONGUE52Tonguetongue
ATTACH_CHIN12Chinchin
ATTACH_FACE_JAW47Jawjaw
ATTACH_LEAR13Left Earleft ear
ATTACH_REAR14Right Earright ear
ATTACH_FACE_LEAR48Alt Left Earleft ear (extended)
ATTACH_FACE_REAR49Alt Right Earright ear (extended)
ATTACH_LEYE15Left Eyeleft eye
ATTACH_REYE16Right Eyeright eye
ATTACH_FACE_LEYE50Alt Left Eyeleft eye (extended)
ATTACH_FACE_REYE51Alt Right Eyeright eye (extended)
ATTACH_NECK39Neckneck
ATTACH_LSHOULDER3Left Shoulderleft shoulder
ATTACH_RSHOULDER4Right Shoulderright shoulder
ATTACH_LUARM20L Upper Armleft upper arm
ATTACH_RUARM18R Upper Armright upper arm
ATTACH_LLARM21L Lower Armleft lower arm
ATTACH_RLARM19R Lower Armright lower arm
ATTACH_LHAND5Left Handleft hand
ATTACH_RHAND6Right Handright hand
ATTACH_LHAND_RING141Left Ring Fingerleft ring finger
ATTACH_RHAND_RING142Right Ring Fingerright ring finger
ATTACH_LWING45Left Wingleft wing
ATTACH_RWING46Right Wingright wing
ATTACH_CHEST1Chestchest/sternum
ATTACH_LEFT_PEC29Left Pecleft pectoral
ATTACH_RIGHT_PEC30Right Pecright pectoral
ATTACH_BELLY28Stomachbelly/stomach/tummy
ATTACH_BACK9Spineback
ATTACH_TAIL_BASE43Tail Basetail base
ATTACH_TAIL_TIP44Tail Tiptail tip
ATTACH_AVATAR_CENTER40Avatar Centeravatar center/root
ATTACH_PELVIS10Pelvispelvis
ATTACH_GROIN53Groingroin
ATTACH_LHIP25Left Hipleft hip
ATTACH_RHIP22Right Hipright hip
ATTACH_LULEG26L Upper Legleft upper leg
ATTACH_RULEG23R Upper Legright upper leg
ATTACH_RLLEG24R Lower Legright lower leg
ATTACH_LLLEG27L Lower Legleft lower leg
ATTACH_LFOOT7Left Footleft foot
ATTACH_RFOOT8Right Footright foot
ATTACH_HIND_LFOOT54Left Hind Footleft hind foot
ATTACH_HIND_RFOOT55Right Hind Footright hind foot
HUD
ConstantComment
ATTACH_HUD_CENTER_231HUD Center 2
ATTACH_HUD_TOP_RIGHT32HUD Top Right
ATTACH_HUD_TOP_CENTER33HUD Top
ATTACH_HUD_TOP_LEFT34HUD Top Left
ATTACH_HUD_CENTER_135HUD Center
ATTACH_HUD_BOTTOM_LEFT36HUD Bottom Left
ATTACH_HUD_BOTTOM37HUD Bottom
ATTACH_HUD_BOTTOM_RIGHT38HUD Bottom Right
Special
ConstantComment
ATTACH_ANY_HUD-1A special constant representing all HUD attachment points when filtering.

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.

Example 1
default
{
state_entry()
{
list attachments = llGetAttachedListFiltered(llGetOwner(), [FILTER_INCLUDE, ATTACH_RHAND]);
// Object UUIDs:
12 collapsed lines
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));
}
}
}
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.