Difference between revisions of "LlGetOwner"

From Second Life Wiki
Jump to: navigation, search
Line 22: Line 22:
 
         llInstantMessage(llGetOwner(),"Only you can hear me. Isn't that eerie.");
 
         llInstantMessage(llGetOwner(),"Only you can hear me. Isn't that eerie.");
 
     }
 
     }
 +
 +
    changed(integer change){if (change & CHANGED_OWNER){llResetScript();}}
 +
 
}</lsl>
 
}</lsl>
 
|helpers
 
|helpers

Revision as of 10:50, 23 February 2008

Summary

Function: key llGetOwner( );

Returns a key that is the owner of the script

IMPORTANT NOTE: If an object is transferred to a new owner and the script not reset, llGetOwner() will continue to return the value of the PREVIOUS owner rather than the new one (this has been reported as a bug in the JIRA system). This can be overcome by resetting the script, but this requires either a manual reset (which is cumbersome) or using an llResetScript() function upon rezzing. Since it is inefficient and in many cases undesirable to reset a script every time an item is rezzed, the following simple one-line workaround is preferrable:

changed(integer change){if (change & CHANGED_OWNER){llResetScript();

Examples

Deep Notes

Search JIRA for related Issues

Signature

function key llGetOwner();

This event checks to see if the owner has changed and if such is the case, resets the script one time.


|spec |caveats |constants |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> |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 }}