llGetNumberOfPrims
integer 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.
- The number of prims returned also includes the number of avatars sitting on the object.
Examples
Section titled “Examples”default { state_entry() { llOwnerSay((string)llGetLinkNumber()); llOwnerSay((string)llGetNumberOfPrims()); }}Helper Function
Section titled “Helper Function”If you need to get the number of prims while excluding seated avatars:
// Returns the number of prims in the object, ignoring seated avatarsinteger getNumberOfPrims() { if (llGetObjectPrimCount(llGetKey()) == 0) return llGetNumberOfPrims(); // attachment return llGetObjectPrimCount(llGetKey()); // non-attachment}See Also
Section titled “See Also”- llGetObjectPrimCount - Returns the number of prims in any object
- llGetLinkNumber - Returns the link number of the prim the script is in