# llDetectedKey

*LSL function*

```lsl
key key llDetectedKey(integer number);
```

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

- Returns: `key`
- Energy: 10

Returns an `empty key` if **number** does not correspond to a valid sensed object or avatar. Returns the key (UUID) of the detected object or avatar specified by number, or NULL_KEY if number is not a valid index.

Returns a [key](https://wiki.secondlife.com/wiki/key) that is the [UUID](https://wiki.secondlife.com/wiki/UUID) of the [detected](/categories/detected/) object or avatar **number**.

```lsl title="How to use" frame="terminal"
key result = llDetectedKey(0);
```

## Examples

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

```lsl
default
{
    touch_start(integer num_detected)
    {
        llSay(0, "touch_start event: key of avatar touching: " + (string) llDetectedKey(0) );
    }
}
```

</details>

---

*Source: [LlDetectedKey](https://wiki.secondlife.com/wiki/LlDetectedKey) on the Second Life Wiki. Content from the Second Life Wiki articles LlDetectedKey (revision 1194087, 2015-01-22) and Template:LSL Function/detected (revision 1168823, 2012-06-11), CC BY-SA 3.0.*

---

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