# PRIM_LINK_TARGET

*LSL constant*

```lsl
integer PRIM_LINK_TARGET = 34;
```

Prim parameter [PRIM_LINK_TARGET, integer link_target] used to get or set properties for multiple linked prims within a single primitive parameters call.

Constant groups: [PrimParam](/constants/groups/PrimParam/)

Used to get or set multiple links with a single PrimParameters call.

## Caveats

- If [PRIM_LINK_TARGET](/constants/PRIM_LINK_TARGET/)'s **link_target** describes a seated avatar...
  - Flags not explicitly mentioned have obvious values.
  - [PRIM_NAME](/constants/PRIM_NAME/) will return the avatar's [legacy name](https://wiki.secondlife.com/wiki/Category:LSL_Legacy_Name).
  - [PRIM_DESC](/constants/PRIM_DESC/) will return `""`.
  - [PRIM_TYPE](/constants/PRIM_TYPE/) will return `[PRIM_TYPE_BOX, PRIM_HOLE_DEFAULT, <0., 1., 0.>, 0., ZERO_VECTOR, <1., 1., 0.>, ZERO_VECTOR]`
  - [PRIM_SLICE](/constants/PRIM_SLICE/) will return `[<0., 1., 0.>]`
  - [PRIM_MATERIAL](/constants/PRIM_MATERIAL/) will return `PRIM_MATERIAL_FLESH`.
  - [PRIM_TEMP_ON_REZ](/constants/PRIM_TEMP_ON_REZ/) will return `FALSE`.
  - [PRIM_PHANTOM](/constants/PRIM_PHANTOM/) will return `FALSE`.
  - [PRIM_SIZE](/constants/PRIM_SIZE/) will return `llGetAgentSize(llGetLinkKey(link))`.
  - [PRIM_TEXT](/constants/PRIM_TEXT/) will return `["", ZERO_VECTOR, 1.]`.
  - [PRIM_POINT_LIGHT](/constants/PRIM_POINT_LIGHT/) will return `[FALSE, ZERO_VECTOR, 0., 0., 0.]`.
  - [PRIM_FLEXIBLE](/constants/PRIM_FLEXIBLE/) will return `[FALSE, 0, 0., 0., 0., 0., ZERO_VECTOR]`.
  - [PRIM_COLOR](/constants/PRIM_COLOR/), [PRIM_TEXTURE](/constants/PRIM_TEXTURE/), [PRIM_GLOW](/constants/PRIM_GLOW/), [PRIM_FULLBRIGHT](/constants/PRIM_FULLBRIGHT/), [PRIM_BUMP_SHINY](/constants/PRIM_BUMP_SHINY/), [PRIM_TEXGEN](/constants/PRIM_TEXGEN/)
    - will return `[]` and report a script error to the owner: "texture info cannot be accessed for avatars."

## Examples

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

```lsl collapse={1-5, 11-17}
default
{
    touch_start(integer num_detected)
    {
    //  color the root prim red and the first linked-prim green
        llSetLinkPrimitiveParamsFast(LINK_ROOT,
                [PRIM_COLOR, ALL_SIDES, <1.0, 0.0, 0.0>, (float)TRUE,
            PRIM_LINK_TARGET, 2,
                PRIM_COLOR, ALL_SIDES, <0.0, 1.0, 0.0>, (float)TRUE]);

    //  instead of:
    //  llSetLinkPrimitiveParamsFast(LINK_ROOT,
    //          [PRIM_COLOR, ALL_SIDES, <1.0, 0.0, 0.0>, (float)TRUE]);
    //  llSetLinkPrimitiveParamsFast(2,
    //          [PRIM_COLOR, ALL_SIDES, <0.0, 1.0, 0.0>, (float)TRUE]);
    }
}
```

</details>

<details>
<summary>Example 2</summary>

```lsl collapse={1-21}
//  assume that you have a global list "gPanels" loaded with the link numbers of prims
//  named "panel" and that the global integer parameter "gON" has been defined ....

    touch_start(integer num)
    {
    //  basic on/off switch
        gON = !gON;

    //  conditions which will change on touch
    //  white panel
        list WhichWay = [PRIM_COLOR, ALL_SIDES, <1.0, 1.0, 1.0>, (float)TRUE];

        if (gON)//  red panel
            WhichWay = [PRIM_COLOR, ALL_SIDES, <1.0, 0.0, 0.0>, (float)TRUE];

    //  to accumulate the parameter list that will be affected by SLPPF in this event
        list params;
        integer numberOfPrims = llGetNumberOfPrims();

    //  Links in a linkset start numbering with 1
        integer index = 1;
        do
        {
        //  build the parameters list, in the format PRIM_LINK_TARGET, link number, parameters
            params += [PRIM_LINK_TARGET, llList2Integer(gPanels, index)] + WhichWay;
        }
        while (++index < numberOfPrims);

    //  apply the parameters to all "panel" prims
        llSetLinkPrimitiveParamsFast(LINK_SET, params);
    }
```

</details>

## See also

### Functions

- [llSetLinkPrimitiveParamsFast](/functions/llSetLinkPrimitiveParamsFast/)
- [llGetLinkPrimitiveParams](/functions/llGetLinkPrimitiveParams/)
- [llGetPrimitiveParams](/functions/llGetPrimitiveParams/)

---

*Source: [PRIM LINK TARGET](https://wiki.secondlife.com/wiki/PRIM_LINK_TARGET) on the Second Life Wiki. Content from the Second Life Wiki articles PRIM LINK TARGET (revision 1194681, 2015-01-23) and Template:LSL PrimitiveParam Categorize (revision 1180644, 2013-08-09), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/constants/PRIM_LINK_TARGET/
