inventory_give

Commands the bot to send an inventory item or folder to a specific avatar.

This command also works in a legacy form: give_inventory

// See "LSL Helper Functions" page for this function
smartbotsAPI("inventory_give", [
  "avatar", "417732f0-a100-4e2d-a9bf-e381cfd12c3a",
  "object", "b572d860-c5cf-e023-a6b2-408f30266acc"
]);

Variables

The following table shows input values (you send them with the API call) and returned output values.

Input basic parameters

Variable

Required

Description

action

yes

= give_inventory

apikey

yes

Your personal developer's API key

botname

yes

Your bot's SL login

secret

yes

Bot access code of your bot

dataType

optional

Set to "json" to get JSON reply instead of URL-encoded string

custom

optional

The custom data (string) to be passed back to caller script. This value will be returned back to the caller in HTTP response

Input

Variable

Required

Description

avatar

yes

The avatar UUID

object

yes

The inventory item or folder UUID. Use the Personal Bot Control Panel or the inventory_list API command to get this UUID.

nosafehub

optional

Set to 1 to ignore the command if the bot is currently in a Linden Safe Hub (Welcome Area). Recommended for greeters and inviters.

Output

(To be received in *http_response* LSL event, see docs for details)

Variable

Description

result

OK - command completed successfully
FAIL - command failed

resulttext

Detailed reason for the failure

custom

The value from input "custom" parameter. See above

Error messages

Before delivering, the bot checks the item’s permissions.
If the object is no-transfer, the following error message is returned:

transfer permission not set

This check does not apply to folders — an empty folder is delivered if no transferable items are found.

Comments

  • The inventory loads each time your bot restarts. Allow about 60 seconds for the inventory to completely load.

  • The bot automatically recognizes inventory folders and delivers them appropriately.

  • The command freezes for about 15 seconds if the provided object UUID does not exist in the bot’s inventory.
    To avoid this, ensure you are using correct UUIDs.