Difference between revisions of "LlGetRegionAgentCount"

From Second Life Wiki
Jump to navigation Jump to search
m (SLuniverse vote)
m (<lsl> tag to <source>)
 
Line 6: Line 6:
|caveats
|caveats
|examples=
|examples=
<lsl>
<source lang="lsl2">
default
default
{
{
Line 16: Line 16:
     }
     }
}
}
</lsl>
</source>
|spec
|spec
|caveats=
|caveats=

Latest revision as of 01:44, 22 January 2015

Summary

Function: integer llGetRegionAgentCount( );
0.0 Forced Delay
10.0 Energy

Returns an integer that is the number of avatars in the region.

Caveats

  • The value returned by this function is technically the average number of agents who were in the region for the past second, rounded to the nearest integer. This means that there is a slight (<1 second) delay in agent count when an agent enters or exits a region.

Examples

default
{
    touch_start(integer num_detected)
    {
        integer numberOfAvatarsInSim = llGetRegionAgentCount();
        llSay(0, "There are currently "
            + (string) numberOfAvatarsInSim + " avatars in this sim.");
    }
}

See Also

Deep Notes

History

Signature

function integer llGetRegionAgentCount();