Skip to content

llReadKeyValue

functionRequires an experience
Function syntax
key llReadKeyValue(
  1. string k// Key of the key-value pair to read
);
Returns
key
Energy
10

Start an asynchronous transaction to read the value associated with the specified key (k) and the script’s Experience.

If the key does not exist the dataserver will return a failure along with the error XP_ERROR_KEY_NOT_FOUND.

Returns a key that can be used to identify the corresponding dataserver event to determine if this command succeeded or failed and the results.

How to use
key result = llReadKeyValue("");
  • The script must be compiled with an experience selected, or the call fails with XP_ERROR_NO_EXPERIENCE. The experience does not need to be allowed on the land: key-value calls work wherever the script runs1
Example 1
key trans;
default
{
state_entry()
{
trans = llReadKeyValue("FOO");
}
dataserver(key t, string value)
{
if (t == trans)
{
// our llReadKeyValue transaction is done
if (llGetSubString(value, 0, 0) == "1")
{
12 collapsed lines
// the key-value pair was successfully read
llSay(0, "New key-value pair value: " + llGetSubString(value, 2, -1));
}
else
{
// the key-value pair failed to read
integer error = (integer)llGetSubString(value, 2, -1);
llSay(0, "Key-value failed to read: " + llGetExperienceErrorMessage(error));
}
}
}
}

The wiki article also includes shared templates whose conditional content is not reproduced here: Template:Issues/BUG-8895.

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.

  1. Confirmed in-world by Nexii Malthus (October 2026). The wiki and the LSL definitions only state that the script must be compiled into an experience; land allowance applies to llRequestExperiencePermissions and what it grants ↩