From Second Life Wiki
GetObjectPrimCount
llGetObjectPrimCount
Description
Function: integer llGetObjectPrimCount( key object_id );
Returns an integer that is the total number of prims for an object in the sim.
Examples
default{
touch_start( integer vIntTouched ){
llSay( PUBLIC_CHANNEL, "This object has "
+ (string)llGetObjectPrimCount( llGetKey() )
+ " prims" );
//-- llGetObjectPrimCount( llGetKey() ) is equavalent to
//-- LlGetNumberOfPrims(), with the option to use it for
//-- any object you have a key for.
}
}