Difference between revisions of "LlGetOwner"

From Second Life Wiki
Jump to navigation Jump to search
(removed incorrect information)
Line 7: Line 7:
|return_text=that is the current owner of the script
|return_text=that is the current owner of the script


NOTE: Because LsL does not reset a script when it is transferred to a new owner, a script can retain old owner identity and even act upon the old owner unless the script is reset. While this appears up front to be a problem with llGetOwner(), this is not the case. The script must be reset upon owner change, which is most easily accomplished using the CHANGE event, as demonstrated below. Without such a reset event, significant problems can be experienced especially in the use of animations and other functions which act upon the owner of the device.
|spec
|spec
|caveats
|caveats

Revision as of 00:07, 24 February 2008

Summary

Function: key llGetOwner( );

Returns a key that is the current owner of the script

NOTE: Because LsL does not reset a script when it is transferred to a new owner, a script can retain old owner identity and even act upon the old owner unless the script is reset. While this appears up front to be a problem with llGetOwner(), this is not the case. The script must be reset upon owner change, which is most easily accomplished using the CHANGE event, as demonstrated below. Without such a reset event, significant problems can be experienced especially in the use of animations and other functions which act upon the owner of the device.

Examples

<lsl>default {

   state_entry()
   {
       llInstantMessage(llGetOwner(),"Only you can hear me. Isn't that eerie.");
   }
changed(integer change){if (change & CHANGED_OWNER){llResetScript();

Deep Notes

Search JIRA for related Issues

Signature

function key llGetOwner();

}</lsl> |helpers |also_functions= |-style="vertical-align:top;" | style="color:gray;" |•  | llGetCreator | style="color:gray;" | | | |-style="vertical-align:top;" | style="color:gray;" |•  | llGetOwnerKey | style="color:gray;" | | | |-style="vertical-align:top;" | style="color:gray;" |•  | llDetectedOwner | style="color:gray;" | | | |also_tests |also_events |also_articles |notes |cat1=Owner |cat2=Object |cat3=Key |cat4 }}