Difference between revisions of "LlGetOwnerKey"

From Second Life Wiki
Jump to navigation Jump to search
m (rewording comments in example script and made variable local)
(Removed superfluous on_rez() event)
Line 17: Line 17:
default
default
{
{
    on_rez(integer start_param)
    {
        llResetScript();
    }
     state_entry()
     state_entry()
     {
     {

Revision as of 17:13, 18 December 2012

Summary

Function: key llGetOwnerKey( key id );

Returns a key that is the owner of prim id

• key id prim UUID that is in the same region

Caveats

  • Returns id if id is not found in the region or is not a prim.
    • Owner information becomes unavailable immediately on derez or detach. For example, if a prim chats at derez or detach time, id can be returned even inside listen events of nearby objects. SVC-5095
  • Also returns id for avatars, use llGetAgentSize instead to distinguish them from prims that do not exist.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl> default {

   state_entry()
   {
   //  listen to anything talking on channel 1
       llListen(1, "", NULL_KEY, "");
   }
   listen(integer channel, string name, key id, string message)
   {
       key ownerOfThisObject = llGetOwner();
       key ownerOfSpeaker = llGetOwnerKey(id);
   //  if whoever is talking is the owner of this object
   //  or if the owner of the object talking is the owner of this object
       if (ownerOfSpeaker == ownerOfThisObject)
       {
           llOwnerSay("'" + name + "' has the same owner as me ^_^");
       }
   }

}

</lsl>

See Also

Functions

•  llKey2Name
•  llRequestAgentData
•  llGetObjectDetails
•  llGetOwner

Deep Notes

Search JIRA for related Issues

Signature

function key llGetOwnerKey( key id );