Difference between revisions of "LlGetInventoryCreator"

From Second Life Wiki
Jump to navigation Jump to search
m
 
(2 intermediate revisions by 2 users not shown)
Line 9: Line 9:
|spec
|spec
|caveats=
|caveats=
* If {{LSLP|item}} has multiple creators, then this function will return [[NULL_KEY]]. (IE: This would happen if an object created by Lex contained a script created by Strife). See {{Jira|SVC-6985}} and {{Jira|SVC-6820}} for more information.
* If {{LSLP|item}} has multiple creators, then this function will return [[NULL_KEY]]. (e.g. if an object created by Lex contained a script created by Strife). See {{Jira|SVC-6985}} and {{Jira|SVC-6820}} for more information.
|constants
|constants
|examples=Add an object to a prims inventory, as well as this script, in order to get the name of the creator.
|examples=Add an object to a prims inventory, as well as this script, in order to get the name of the creator.
<lsl>default{
<source lang="lsl2">default{
     state_entry(){
     state_entry(){
         llRequestAgentData(llGetInventoryCreator(llGetInventoryName( INVENTORY_OBJECT, 0)),DATA_NAME);
         llRequestAgentData(llGetInventoryCreator(llGetInventoryName( INVENTORY_OBJECT, 0)),DATA_NAME);
Line 20: Line 20:
         llOwnerSay(data);
         llOwnerSay(data);
     }
     }
}</lsl>
}</source>
|helpers
|helpers
|also_functions=
|also_functions=
{{LSL DefineRow||[[llGetInventoryAcquireTime]]|Returns the time the item was added to the prim's inventory}}
{{LSL DefineRow||[[llGetInventoryName]]|Returns the inventory item's name}}
{{LSL DefineRow||[[llGetInventoryName]]|Returns the inventory item's name}}
{{LSL DefineRow||[[llGetInventoryType]]|Tests to see if an inventory item exists and returns its type}}
{{LSL DefineRow||[[llGetInventoryType]]|Tests to see if an inventory item exists and returns its type}}

Latest revision as of 08:15, 28 May 2021

Summary

Function: key llGetInventoryCreator( string item );
0.0 Forced Delay
10.0 Energy

Returns a key of the creator of the inventory item.

• string item an item in the inventory of the prim this script is in

Caveats

  • If item is missing from the prim's inventory then an error is shouted on DEBUG_CHANNEL.
  • If item has multiple creators, then this function will return NULL_KEY. (e.g. if an object created by Lex contained a script created by Strife). See SVC-6985 and SVC-6820 for more information.

Examples

Add an object to a prims inventory, as well as this script, in order to get the name of the creator.

default{
    state_entry(){
        llRequestAgentData(llGetInventoryCreator(llGetInventoryName( INVENTORY_OBJECT, 0)),DATA_NAME);
    }
    
    dataserver(key qid, string data){
        llOwnerSay(data);
    }
}

See Also

Functions

•  llGetInventoryAcquireTime Returns the time the item was added to the prim's inventory
•  llGetInventoryName Returns the inventory item's name
•  llGetInventoryType Tests to see if an inventory item exists and returns its type
•  llGetInventoryNumber Returns the number of items of a specific type in inventory
•  llGetInventoryPermMask Returns the inventory item's permissions
•  llGetInventoryKey Returns the inventory item's UUID (if full perm)

Deep Notes

Signature

function key llGetInventoryCreator( string item );