llGetNumberOfPrims
LSLinteger llGetNumberOfPrims()
Returns the number of prims in a link set the script is attached to.\ Returns the number of prims in (and avatars seated on) the object the script is in.
Takes no parameters.
Energy
10
The Linden Scripting Library — what every SL-compatible grid provides.