Skip to content
lsl.devlsl.devLSL Dev

AGENT_WALKING

constant
Constant
integer AGENT_WALKING = 0x80;

Used with llGetAgentInfo to determine if the queried avatar is walking, running, or crouch walking.

Constant groups

AgentInfo

Other AgentInfo values (15)

Used with llGetAgentInfo to determine if the queried avatar is walking.

Cause a sound to be played while the wearer of the hud or attachment is walking.

Place this script in a Hud for the owner only to hear the sound,

or in an attachment for others to hear your footsteps too.

You’ll need a sound file in the object too, with your choice of footstep sounds.

10 collapsed lines
// Play a sound whenever the owner is walking
integer gWasWalking; // TRUE when wearer is already walking
string gSound = "footsteps"; // name of soundfile in inventory
default
{
state_entry()
{
// Start a timer to continuously check if the owner is walking
llSetTimerEvent(0.25);
}
timer()
{
integer NowWalking = llGetAgentInfo(llGetOwner()) & AGENT_WALKING;
if (NowWalking != gWasWalking) // walking has stopped or started
{
6 collapsed lines
llStopSound();
if (NowWalking) llLoopSound(gSound, 1.0);
}
gWasWalking = NowWalking;
}
}
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
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. ↩