From Second Life Wiki
Revision as of 23:53, 3 August 2011 by Kaluura Boa (Talk | contribs)

Jump to: navigation, search


Function: integer llGetObjectPrimCount( key prim );

Returns an integer that is the total number of prims in the object that contains prim.

• key prim prim UUID that is in the same region

Avatars sitting on the object are not counted[1]. Zero is returned if prim (1) is not found, (2) is part of an attachment[2], or (3) is not a prim.


  • This cannot be used to detect if an avatar is seated (by checking for a non-zero return), use llGetAgentInfo instead.
  • The prim count for attachments are not returned[2]. If possible use llGetNumberOfPrims instead.
All Issues ~ Search JIRA for related Bugs


<lsl>default {

   touch_start(integer num)
       integer prims = llGetObjectPrimCount(llGetKey());
       if (prims == 0)
           // llGetObjectPrimCount returns zero for attachments.
           prims = llGetNumberOfPrims();
           // Avatars can't sit on attachments so this is ok.
       llOwnerSay("This object has "
                   + (string)prims
                   + " prims and "
                   + (string)(llGetNumberOfPrims() - prims)
                   + " avatars.");

See Also


•  llGetNumberOfPrims Returns the number of prims in the current object.

Deep Notes

Search JIRA for related Issues


  1. ^ llGetNumberOfPrims on the other hand does count avatars sitting on the object.
  2. ^ Weather the attachment exception is a bug or a feature is unclear.


function integer llGetObjectPrimCount( key prim );