Difference between revisions of "LlGetOwnerKey"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 14: Line 14:
|constants
|constants
|examples=
|examples=
<lsl>
<source lang="lsl2">
default
default
{
{
Line 37: Line 37:
     }
     }
}
}
</lsl>
</source>
|helpers
|helpers
|also_functions={{LSL DefineRow||[[llKey2Name]]|}}
|also_functions={{LSL DefineRow||[[llKey2Name]]|}}

Revision as of 01:24, 22 January 2015

Summary

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

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.

Examples

default
{
    state_entry()
    {
    //  listen to anything talking on channel 1
        llListen(1, "", NULL_KEY, "");
    //  Type "/1 " + message (such as "/1 poke") to chat 'message' on channel 1.
    }

    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 ^_^");
        }
    }
}

See Also

Deep Notes

Signature

function key llGetOwnerKey( key id );