Difference between revisions of "LlGetOwnerKey"
Jump to navigation
Jump to search
All Issues ~ Search JIRA for related Bugs
m |
Kireji Haiku (talk | contribs) m (rewording comments in example script and made variable local) |
||
Line 13: | Line 13: | ||
* Also returns {{LSLP|id}} for avatars, use [[llGetAgentSize]] instead to distinguish them from prims that do not exist. | * Also returns {{LSLP|id}} for avatars, use [[llGetAgentSize]] instead to distinguish them from prims that do not exist. | ||
|constants | |constants | ||
|examples=<lsl> | |examples= | ||
<lsl> | |||
default | default | ||
{ | { | ||
on_rez(integer start_param) | |||
{ | { | ||
llResetScript(); | |||
} | } | ||
state_entry() | |||
{ | { | ||
// listen to anything talking on channel 1 | |||
llListen(1, "", NULL_KEY, ""); | |||
} | } | ||
listen(integer | |||
listen(integer channel, string name, key id, string message) | |||
{ | { | ||
key ownerOfThisObject = llGetOwner(); | |||
key ownerOfSpeaker = llGetOwnerKey(id); | |||
llOwnerSay(name + " has the same owner as me ^_^"); | |||
// 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> | } | ||
</lsl> | |||
|helpers | |helpers | ||
|also_functions={{LSL DefineRow||[[llKey2Name]]|}} | |also_functions={{LSL DefineRow||[[llKey2Name]]|}} |
Revision as of 04:17, 25 November 2012
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: key llGetOwnerKey( key id );182 | Function 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.
- Also returns id for avatars, use llGetAgentSize instead to distinguish them from prims that do not exist.
Examples
<lsl> default {
on_rez(integer start_param) { llResetScript(); }
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 |