function
Function syntax
llGiveInventory(key target,// UUID of the target agent or prim.string item// Name of the item in the prim's inventory to transfer.
);- Energy
- 10
Give inventory to destination.
If destination is an object then it must be in the same region.
If destination is an avatar they do not have to be in the same region.
llGiveInventory(NULL_KEY, "");Caveats
Section titled “Caveats”- There is no way to know if the transaction failed. Unless you send a message when inventory is given to a prim and prim’s script checks its inventory and sends a message back using
llRegionSay. - Scripts reach
destinationdisabled (not running, and cannot be made to run unless the destination object is taken to inventory and rezzed again, or the script is recompiled). To send a running script to a prim usellSetRemoteScriptAccessPinandllRemoteLoadScriptPin. - If
destinationis locked theninventoryis not transferred and a Blocked by permissions error is shouted on theDEBUG_CHANNEL. - If
destinationobject is not modifiable theninventoryis not transferred and a Blocked by permissions error is shouted on theDEBUG_CHANNEL. - If
inventoryis no-copy it is transfered todestinationwithout copying it. Since it is no-copy the only copy is given todestination; removing it from the source prim’s inventory. - the
changedevent does not fire in this case - To avoid this problem use
llGetInventoryPermMaskto check the permissions ofinventory. - Attachments cannot give or receive no-copy inventory. When attempted an error is shouted on
DEBUG_CHANNEL. - When giving to an attachment that is not owned by the script owner, the receiving attachment must have
llAllowInventoryDropset toTRUE. - If
destinationis an avatar that refuses to accept it (by manual decline or muting), is in busy mode, or is offline with instant messages capped, it is not returned to the prim’s inventory; it is deleted. - It is not returned to the owner. It does not show up in their lost and found or any other inventory folder.
- It is not put in the target’s trash folder.
- A successful send to an offline avatar by means of
llGiveInventory()counts as an IM against that avatar’s IM cap. - As of 31th January 2012,
llGiveInventorynow has similar throttle to instant messages. A throttle of 5k per hour per owner per region; with a maximum burst of 2.5k. This throttle only affects gives to agents, not to non-agents. - “With 3k subscribers you will want to send slow enough that it takes ~45 minutes to send 1 item to each subscriber. A general safe way would be to send ~2k as fast as you can, then wait 31 minutes and send another 2k.” Kelly Linden on SVC-7631
- Be aware that while you script a system to handle the top of these limits that other busy scripted objects can be adding up to the throttle as well, such as vendors.
Examples
Section titled “Examples”Example 1
default{ touch_start(integer n) { //Gives this script to whoever touches the object. llGiveInventory(llDetectedKey(0), llGetScriptName()); }}Known issues
Section titled “Known issues”From the issue templates included by the wiki article:
- SVC-7631 (bug): New rate throttle on llGiveInventory
- BUG-5656 (bug): llGiveInventory fails when no-copy items are given to attachments (even no-copy ones)
See also
Section titled “See also”Functions
Section titled “Functions”llGiveInventoryListllGiveAgentInventoryllRemoteLoadScriptPinllSetRemoteScriptAccessPinllMapDestination
Events
Section titled “Events”Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.