Difference between revisions of "LlGetOwner"
Jump to navigation
Jump to search
All Issues ~ Search JIRA for related Bugs
m |
|||
Line 10: | Line 10: | ||
**This requires the reregistration of [[llListen|listens]] and [[llRequestPermissions|requesting of permissions]] from the new owner as needed. | **This requires the reregistration of [[llListen|listens]] and [[llRequestPermissions|requesting of permissions]] from the new owner as needed. | ||
***This is not limited to listens and permissions but anything that caches the return value, it is up to the programmer to work around this limitation. | ***This is not limited to listens and permissions but anything that caches the return value, it is up to the programmer to work around this limitation. | ||
**Detection of owner change can be achieved with the [[changed]] event in conjunction with the [[CHANGED_OWNER]] flag (see the first example) or by storing the old value and periodically ([[on_rez]]) checking if it has changed. Both techniques are valid though the latter will not detect the sale of the object if it is sold | **Detection of owner change can be achieved with the [[changed]] event in conjunction with the [[CHANGED_OWNER]] flag (see the first example) or by storing the old value and periodically (e.g. in [[on_rez]]) checking if it has changed. Both techniques are valid though the latter will not detect the sale of the object if it is sold with "sell original" in-world and not picked up. | ||
|constants | |constants | ||
|examples=<lsl>default | |examples=<lsl>default |
Revision as of 11:16, 24 February 2008
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: key llGetOwner( );117 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Returns a key that is the current owner of the script.
Caveats
- When the owner of an object changes, code that depends on this function's return value will not automatically update for the new owner or be automatically re-evaluated.
- This requires the reregistration of listens and requesting of permissions from the new owner as needed.
- This is not limited to listens and permissions but anything that caches the return value, it is up to the programmer to work around this limitation.
- Detection of owner change can be achieved with the changed event in conjunction with the CHANGED_OWNER flag (see the first example) or by storing the old value and periodically (e.g. in on_rez) checking if it has changed. Both techniques are valid though the latter will not detect the sale of the object if it is sold with "sell original" in-world and not picked up.
- This requires the reregistration of listens and requesting of permissions from the new owner as needed.
Examples
<lsl>default {
state_entry() { llInstantMessage(llGetOwner(), "Only you can hear me. Isn't that eerie."); }
changed(integer change) { if (change & CHANGED_OWNER) llResetScript(); }}</lsl>
See Also
Functions
• | llGetCreator | |||
• | llGetOwnerKey | |||
• | llDetectedOwner |