Skip to content
lsl.devlsl.devLSL Dev

llTransferOwnership

function
Function syntax
integer llTransferOwnership(
  1. key agent,// UUID of the agent to receive ownership of the object.
  2. integer flags,// Flags controlling the transfer type (such as TRANSFER_FLAG_COPY or TRANSFER_FLAG_TAKE). Values: TransferOwnershipFlag
  3. list options// Extra options applied to the transfer (currently unused).
);
Returns
integer
Energy
10

Transfers ownership of the object (or a copy of it, depending on Flags) to the specified agent. Returns an integer indicating the success or failure of the transfer.

Transfer ownership of the object containing this script to agent_id.

Returns an integer indicating the result of the transfer.

How to use
integer result = llTransferOwnership(NULL_KEY, 0, []);

Transfers ownership of an object rezzed in world to agent_id. The object must be transferable by its current owner and must not be an attachment.

Optionally this function may force the object to derez itself into the destination agent’s inventory, or make a copy of itself directly into inventory.

ConstantDescription
TRANSFER_FLAG_RESERVED0x0001Reserved, do not use.
TRANSFER_FLAG_TAKE0x0002When transfer is accepted, immediately take the object into inventory.
TRANSFER_FLAG_COPY0x0004Give a copy of the object and place it into the destination agent’s inventory.
ConstantDescription
TRANSFER_OK0No error detected, inventory transferred
TRANSFER_BAD_OPTS-1A bad option was passed in the options list.
TRANSFER_NO_TARGET-2Could not find the receiving agent in the current region.
TRANSFER_THROTTLE-3Transfer rate exceeded the inventory transfer throttle.
TRANSFER_NO_ITEMS-4The list of items was empty or contained only non-transferable items.
TRANSFER_BAD_ROOT-5The root path specified in TRANSFER_DEST contained an invalid directory or was reduced to nothing.
TRANSFER_NO_PERMS-6The object does not have transfer permissions.
TRANSFER_NO_ATTACHMENT-7Can not transfer ownership of an attached object.
  • agent_id must be an agent in the region.
  • There is no way to detect if the receiver ignored, rejected or blocked the transaction (aside from a changed event never occurring.)
  • The function fails with a return code of TRANSFER_NO_PERMS if:
  • The object is no-transfer.
  • The object is no-copy and flags includes the TRANSFER_FLAG_COPY flag.
  • Calling this function from an attachment will fail and return TRANSFER_NO_ATTACHMENT
  • WARNING: Any no-trans items in the transferred object will be removed from the object received by the target agent. If the transfer is of the object itself, these items are lost.
  • WARNING: If the transfer is a copy, any no-copy inventory items will be present in the object received by the target agent and removed from the original.
Example 1
default
{
touch_start(integer total_number)
{
llTransferOwnership(llDetectedKey(0), TRANSFER_FLAG_COPY, []);
}
}

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)
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.