llGiveInventory

From Second Life Wiki
Revision as of 02:21, 13 October 2010 by Cerise Sorbet (talk | contribs)
Jump to navigation Jump to search

Summary

Function: llGiveInventory( key destination, string inventory );

Give inventory to destination.

• key destination avatar or prim UUID
• string inventory an item in the inventory of the prim this script is in

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.

Caveats

  • If destination is an avatar the script sleeps for 2.0 seconds. (Giving to objects or attachments has no delay)
  • If destination is not the owner nor shares the same owner, and inventory does not have transfer permissions, an error is shouted on DEBUG_CHANNEL.
  • When scripts are copied or moved between inventories, their state does not survive the transfer. Memory, event queue and execution position are all discarded.
  • If inventory is missing from the prim's inventory then an error is shouted on DEBUG_CHANNEL.
  • There is no way to know if the transaction failed.
  • 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.
  • If destination is locked then inventory cannot be transferred and a Blocked by permissions error is shouted on the DEBUG_CHANNEL.
  • If inventory is no-copy the item is transfered to destination without copying it. Since it is no-copy the only copy is given to destination; removing it from the prim's inventory.
  • 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.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl>default {

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

See Also

Deep Notes

Search JIRA for related Issues

Tests

•  llGiveInventory Test

Signature

function void llGiveInventory( key destination, string inventory );