Syntax

integer llGetNumberOfPrims();

Forced delay: 0.0 seconds. Energy: 10.0.

Return value

Returns an integer that is the number of prims in a link set the script is attached to.

Caveats

Examples

default
{
    state_entry()
    {
        llOwnerSay((string)llGetLinkNumber());
        llOwnerSay((string)llGetNumberOfPrims());
    }
}

Useful snippets

// Returns the number of prims in the object, ignoring seated avatars
integer getNumberOfPrims(){
  if (llGetObjectPrimCount(llGetKey()) == 0 ) return llGetNumberOfPrims(); // attachment
  return llGetObjectPrimCount(llGetKey());   // non-attachment
}

See also

Functions