integer llGetObjectPrimCount( key prim );
Forced delay: 0.0 seconds. Energy: 10.0.
Avatars sitting on the object are not counted[1]. Zero is returned if prim: (A) is not found, (B) is part of an attachment[2], or (C) is not a prim.
Returns an integer that is the total number of prims in the object that contains prim.
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.");
}
}