# llDetectedOwner

*LSL function*

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

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

- Returns: `key`
- Energy: 10

Returns the key (UUID) of the owner of the detected object specified by number. Returns an invalid key if number is not a valid index.

Returns an `empty key` if **number** does not relate to a valid sensed object

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

## Examples

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

```lsl
default
{
    collision_start(integer num_detected)
    {
        string output =
            "\nkey of colliding object's owner ... or the colliding avatar: " + (string)llDetectedOwner(0)
            + "\nkey of this object's owner: " + (string)llGetOwner()
            + "\nname of colliding object/avatar: " + llDetectedName(0)
            + "\nkey of colliding object/avatar: " + (string)llDetectedKey(0)
            + "\nkey of the prim containing this script: " + (string)llGetKey()
            + "\nkey of this object's root prim: " + (string)llGetLinkKey(LINK_ROOT);
        llSay(0, output);
    }
}
```

</details>

## Notes

If the [detected type](/functions/llDetectedType/) is an [avatar](/constants/AGENT_BY_LEGACY_NAME/) the key of that avatar is returned. Avatars are owned by themselves. [llGetOwnerKey](/functions/llGetOwnerKey/) works the same way with regards to avatar UUIDs.

## See also

### Functions

- [llGetOwnerKey](/functions/llGetOwnerKey/) — `llGetOwnerKey(llDetectedKey(number))` is the same as `llDetectedOwner(number)` only if the detected object is in the same region.
- [llGetOwner](/functions/llGetOwner/)

---

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

---

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