# llGiveInventory

*LSL function*

```lsl
void llGiveInventory(key target, string item);
```

- `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](https://wiki.secondlife.com/wiki/region).

If `destination` is an avatar they do not have to be in the same region.

```lsl title="How to use" frame="terminal"
llGiveInventory(NULL_KEY, "");
```

## 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](/functions/llRegionSay/).
- Scripts reach `destination` disabled (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 use [llSetRemoteScriptAccessPin](/functions/llSetRemoteScriptAccessPin/) and [llRemoteLoadScriptPin](/functions/llRemoteLoadScriptPin/).
- If `destination` is locked then `inventory` is not transferred and a **Blocked by permissions** error is shouted on the [DEBUG_CHANNEL](/constants/DEBUG_CHANNEL/).
- If `destination` object is not modifiable then `inventory` is not transferred and a **Blocked by permissions** error is shouted on the [DEBUG_CHANNEL](/constants/DEBUG_CHANNEL/).
- If `inventory` is no-copy it is transfered to `destination` without copying it. Since it is no-copy the only copy is given to `destination`; removing it from the source prim's inventory.
- the [changed](/events/changed/) event does **not** fire in this case
- To avoid this problem use [llGetInventoryPermMask](/functions/llGetInventoryPermMask/) to check the permissions of `inventory`.
- [Attachments](https://wiki.secondlife.com/wiki/Attachment) cannot give or receive no-copy inventory. When attempted an error is shouted on [DEBUG_CHANNEL](/constants/DEBUG_CHANNEL/).
- When giving to an attachment that is not owned by the script owner, the receiving attachment must have [llAllowInventoryDrop](/functions/llAllowInventoryDrop/) set to [TRUE](/constants/TRUE/).
- If `destination` is 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, `llGiveInventory` now 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](https://jira.secondlife.com/browse/SVC-7631?focusedCommentId=308665&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-308665)
- 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

<details open>
<summary>Example 1</summary>

```lsl
default
{
    touch_start(integer n)
    {
        //Gives this script to whoever touches the object.
        llGiveInventory(llDetectedKey(0), llGetScriptName());
    }
}
```

</details>

## Tests

- [llGiveInventory Test](https://wiki.secondlife.com/wiki/llGiveInventory_Test)

## 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

### Functions

- [llGiveInventoryList](/functions/llGiveInventoryList/)
- [llGiveAgentInventory](/functions/llGiveAgentInventory/)
- [llRemoteLoadScriptPin](/functions/llRemoteLoadScriptPin/)
- [llSetRemoteScriptAccessPin](/functions/llSetRemoteScriptAccessPin/)
- [llMapDestination](/functions/llMapDestination/)

### Events

- [changed](/events/changed/)

---

*Source: [LlGiveInventory](https://wiki.secondlife.com/wiki/LlGiveInventory) on the Second Life Wiki. Content from the Second Life Wiki articles LlGiveInventory (revision 1218296, 2025-05-17), Template:LSL Function/give (revision 1212353, 2022-09-24), Template:Issues/SVC-7631 (revision 1162332, 2012-02-01) and Template:Issues/BUG-5656 (revision 1189350, 2014-04-10), CC BY-SA 3.0.*

---

From lsl.dev: https://lsl.dev/functions/llGiveInventory/
