Difference between revisions of "LlGetOwnerKey"

From Second Life Wiki
Jump to navigation Jump to search
(Documented attach speak on detach, owner not found bug.)
(It is other objects that cannot retrieve the owner information, an object can return its own llGetOwnerKey even in attach.)
Line 9: Line 9:
|caveats=
|caveats=
* Returns '''id''' if '''id''' is not found in the region or is not an object.
* Returns '''id''' if '''id''' is not found in the region or is not an object.
** If an attached object speaks on detach, the id of the object, not the owner, will be returned. [[https://jira.secondlife.com/browse/SVC-5095 SVC-5095]]
** Owner information becomes unavailable ''immediately'' on derez or detach. For example, if an object chats at derez or detach time, '''id''' can be returned even inside [[listen]] events of nearby objects. <sup>{{Jira|SVC-5095}}</sup>
* '''id''' can be any prim in the object.
* '''id''' can be any prim in the object.
|constants
|constants

Revision as of 21:48, 28 September 2010

Summary

Function: key llGetOwnerKey( key id );
0.0 Forced Delay
10.0 Energy

Returns a key that is the owner of object id

• key id group, avatar or prim UUID that is in the same region

Caveats

  • Returns id if id is not found in the region or is not an object.
    • Owner information becomes unavailable immediately on derez or detach. For example, if an object chats at derez or detach time, id can be returned even inside listen events of nearby objects. SVC-5095
  • id can be any prim in the object.

Examples

<lsl>key owner;

default {

   state_entry()
   {
       owner = llGetOwner();
       llListen(1, "", "", "");
   }
   on_rez(integer a)
   {
       owner = llGetOwner();
   }
   listen(integer chan, string name, key id, string msg)
   {
       if(llGetOwnerKey(id) == owner)
       {//Only triggers if what spoke is the owner or if they share the same owner
           llOwnerSay(name + " has the same owner as me ^_^");
       }
   }
}</lsl>

Notes

When used on an avatars key, the key of that avatar is returned again. So avatars are owned by themself.

See Also

Functions

•  llKey2Name
•  llRequestAgentData
•  llGetObjectDetails
•  llGetOwner

Deep Notes

Signature

function key llGetOwnerKey( key id );