# llDetectedName

*LSL function*

```lsl
string string llDetectedName(integer item);
```

- `integer item`: Index of the detection information.

- Returns: `string`
- Energy: 10

Returns

[NULL_KEY](/constants/NULL_KEY/)

if **item** is not valid.

If the item detected is an avatar then the [legacy name](https://wiki.secondlife.com/wiki/Category:LSL_Avatar/Name) is returned.

Returns a [string](https://wiki.secondlife.com/wiki/string) that is the name of the [detected](/categories/detected/) **item**.

```lsl title="How to use" frame="terminal"
string result = llDetectedName(0);
```

## Examples

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

```lsl
default
{
    touch_start(integer num_detected)
    {
        string name = llDetectedName(0);

        llOwnerSay("Touched by " + name);

       // name is the legacy name, as in "John Doe", or "John Resident" if the avatar has the default last name.
    }
}
```

</details>

---

*Source: [LlDetectedName](https://wiki.secondlife.com/wiki/LlDetectedName) on the Second Life Wiki. Content from the Second Life Wiki articles LlDetectedName (revision 1216094, 2024-01-20), Template:LSL Constant/NULL KEY (revision 59847, 2008-03-24) and Template:LSL Function/detected (revision 1168823, 2012-06-11), CC BY-SA 3.0.*

---

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