Skip to content
lsl.devlsl.devLSL Dev

llReturnObjectsByID

function
Function syntax
integer llReturnObjectsByID(
  1. list objects// A list of object UUID keys to return.
);
Returns
integer
Energy
10

If the script is owned by an agent, PERMISSION_RETURN_OBJECTS may be granted by the owner. If the script is owned by a group, this permission may be granted by an agent belonging to the group’s “Owners” role.

If the return value is negative, it represents an error flag.

Returns an integer that is the number of objects successfully returned to their owners or an ERR_* flag.

How to use
integer result = llReturnObjectsByID([]);

If the script is owned by an estate owner or manager, this function works for objects located on any parcel in the region. Otherwise, the script can return objects located over land owned by the owner of the script.

As a security measure, parcel owner, estate owner, and estate managers can not have their objects returned by this method, except when the object returns itself.

Throttled at max parcel land impact capacity region-wide per hour.

ConstantTypeValueDescription
ERR_GENERICinteger-1A nebulous and inexplicable error, nothing is known about it.
ERR_PARCEL_PERMISSIONSinteger-2Permission lacked to perform task on specified parcel.
ERR_MALFORMED_PARAMSinteger-3Parameters are malformed.
ERR_RUNTIME_PERMISSIONSinteger-4Script lacks the runtime permission to perform the requested task.
ERR_THROTTLEDinteger-5Task has been throttled. Try again later.
Error FlagsDescription
  • Objects owned by other groups will be returned to their previous owner if the object is transferable, deleted otherwise.
Example 1
48 collapsed lines
key owner;
// list of objects to return
list objects_to_return = [
"929f26d8-b225-5f6a-a26a-eeda27c31416",
"f0abe779-1989-6be4-d73c-dcb48b4313cf",
"bad9903-139f-2217-81f3-e61884540df6"
];
default
{
state_entry()
{
llRequestPermissions(llGetOwner(),PERMISSION_RETURN_OBJECTS);
}
run_time_permissions(integer p)
{
if (p & PERMISSION_RETURN_OBJECTS)
{
llSetText("Touch me to return the list of objects defined in this script",<1,1,0>,1);
}
}
touch_start(integer total_number)
{
if ((llGetPermissions() & PERMISSION_RETURN_OBJECTS) == 0)
{
llOwnerSay("Requesting permission to return objects.");
llRequestPermissions(llGetOwner(),PERMISSION_RETURN_OBJECTS);
}
else
{
list found_objects = [];
integer n = llGetListLength(objects_to_return);
while(--n >= 0)
{
key object = llList2Key(objects_to_return, n);
string pos = llList2String(llGetObjectDetails(object, [OBJECT_POS]), 0);
if(pos == "" )
{
llOwnerSay( "Object in return list " + (string)object + " not found - skipping.");
}
else
{
llOwnerSay("Adding object " + (string)object + " at " + (string)pos + " to return list.");
found_objects += [object];
}
}
llOwnerSay("Found " + (string)llGetListLength(found_objects) + " objects to return.");
integer result = llReturnObjectsByID(found_objects);
if(result >= 0)
{
llOwnerSay("Returned " + (string)result + " objects.");
}
else
{
llOwnerSay("llReturnObjectsByID returned error code " + (string)result
+ " - see https://wiki.secondlife.com/wiki/LlReturnObjectsByID for meaning");
}
}
}
}

Date of Release 18/06/2013

From the issue templates included by the wiki article:

  • SVC-6281 (fs): Shared group inventory
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.