Difference between revisions of "LlGiveInventory"

From Second Life Wiki
Jump to navigation Jump to search
(a little more on what happens to scripts sent to objects)
m
Line 1: Line 1:
{{LSL_Function/inventory|inventory|uuid=false|type}}{{LSL_Function
{{LSL_Function/give|destination|inventory|uuid=false}}{{LSL_Function
|func_id=150|func_sleep=0.0|func_energy=10.0|func_sleep_note=If '''destination''' is an avatar the script sleeps for 2.0 seconds. (Giving to attachments has no delay)
|func_id=150|func_sleep=0.0|func_energy=10.0|func_sleep_note=If '''destination''' is an avatar the script sleeps for 2.0 seconds. (Giving to objects or attachments has no delay)
|func=llGiveInventory
|func=llGiveInventory
|p1_type=key|p1_name=destination|p1_desc=Avatar or object [[UUID]].
|p1_type=key|p1_name=destination|p1_desc
|p2_type=string|p2_name=inventory
|p2_type=string|p2_name=inventory
|func_footnote=If '''destination''' is an object then it must be in the same [[region]].<br/>If '''destination''' is an avatar they do not have to be in the same region.
|func_footnote=If '''destination''' is an object then it must be in the same [[region]].<br/>If '''destination''' is an avatar they do not have to be in the same region.
Line 8: Line 8:
|return_text
|return_text
|spec
|spec
|caveats=*There is no way to know if the transaction failed.
|caveats=
*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]]
*There is no way to know if the transaction failed.
*If '''destination''' is a prim, it must be in the same region.
*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]].
|constants
|constants
|examples=
|examples=

Revision as of 06:38, 13 May 2009

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.
  • If inventory permissions do not allow copy, the transfer fails and an error is shouted on DEBUG_CHANNEL.
  • If destination is a prim that is not in the same region 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.
  • If destination is a prim, it must be in the same region.
  • 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.
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 );