From Second Life Wiki
Function: key llDetectedKey( integer number );
Returns a key that is the UUID of the detected object or avatar number.
|| Index of detection information
number does not support negative indexes.
Returns an empty key if number does not correspond to a valid sensed object or avatar.
- If number is out of bounds the script continues to execute without an error message.
- Events that enable the llDetected* functions always return at least one detected item.
- Detection events are not raised if there is nothing detected.
- The detection event's items detected parameter is initially never less than 1.
~ Search JIRA for related Bugs