Skip to content
lsl.devlsl.devLSL Dev

llGetAgentInfo

function
Function syntax
integer llGetAgentInfo(
  1. key id// UUID of the avatar in the same region.
);
Returns
integer
Energy
10

Returns an integer bitfield containing status information about the agent specified by id (such as AGENT_FLYING, AGENT_ATTACHMENTS, AGENT_SITTING, etc.).

Returns an integer containing the agent information about id.

How to use
integer result = llGetAgentInfo(NULL_KEY);
ConstantValReturned if agent…
40960x1000has running ("Always Run") enabled, or is using tap-tap-hold
20x0002has attachments
163840x4000is marked as a scripted agent/bot
81920x2000is in "autopilot" mode
640x0040is in "away" mode
20480x0800is in "busy" mode
10240x0400is crouching
327680x8000is floating or hovering because of a scripted attachment
10x0001is flying or hovering
2560x0100is in the air (jumping, flying or falling)
80x0008is in mouselook
320x0020is sitting on an object (and linked to it)
40x0004has scripted attachments
160x0010is sitting1
5120x0200is typing
1280x0080is walking, running or crouch walking
Example 1
default
{
touch_start(integer buf)
{
buf = llGetAgentInfo(llDetectedKey(0));
string out;
if(buf & AGENT_FLYING)
21 collapsed lines
out += "The agent is flying.\n";
else
out += "The agent is not flying.\n";
if(buf & AGENT_ATTACHMENTS)
{
if(buf & AGENT_SCRIPTED)
out += "The agent has scripted attachments.\n";
else
out += "The agent's attachments are unscripted.\n";
}
else
out += "The agent does not have attachments.\n";
if(buf & AGENT_MOUSELOOK)
out += "the agent is in mouselook.";
else
out += "the agent is in normal camera mode.";
llWhisper(0, out);
}
}

This is not a good way of testing if an avatar is in the region, use llGetAgentSize instead.

Added in SL 0.4.0 along with these flags AGENT_FLYING, AGENT_ATTACHMENTS, & AGENT_SCRIPTED.

From the issue templates included by the wiki article:

  • SVC-91 (nf): agent_info() event
  • SVC-3177 (bug): llGetAgentInfo() returns unreliable info after a sim border crossing
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. “Sit down” on the avatar context menu allows ground sits anywhere: atop the terrain, on objects or even in the air, so it is possible to sit “on” an object without linking. ↩