Difference between revisions of "LlGetRegionAgentCount"

From Second Life Wiki
Jump to navigation Jump to search
m (added date of release)
m (SLuniverse vote)
Line 12: Line 12:
     {
     {
         integer numberOfAvatarsInSim = llGetRegionAgentCount();
         integer numberOfAvatarsInSim = llGetRegionAgentCount();
 
         llSay(0, "There are currently "
    //  PUBLIC_CHANNEL has the integer value 0
             + (string) numberOfAvatarsInSim + " avatars in this sim.");
 
         llSay(PUBLIC_CHANNEL, "Hello, currently there are "
             + (string)numberOfAvatarsInSim + " avatars in my sim.");
     }
     }
}
}

Revision as of 13:39, 10 June 2014

Summary

Function: integer llGetRegionAgentCount( );

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.
All Issues ~ Search JIRA for related Bugs

Examples

<lsl> default {

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

}

</lsl>

See Also

Deep Notes

History

Search JIRA for related Issues

Signature

function integer llGetRegionAgentCount();