De DigiWiki.
default
{
state_entry()
{
llOwnerSay((string)llGetLinkNumber());
llOwnerSay((string)llGetNumberOfPrims());
}
}
// Returns the number of prims in the object, ignoring seated avatars
integer GetNumberOfPrims()
{
if (llGetAttached())
{
// llGetObjectPrimCount fails on attachments, but you can't sit on an attachment
return llGetNumberOfPrims();
}
return llGetObjectPrimCount(llGetKey());
}
//-- inline version of the above
(llGetObjectPrimCount( llGetKey() ) + llGetNumberOfPrims() * !!llGetAttached())
// Returns the number of agents on the object
integer GetNumberOfAgents()
{
return llGetNumberOfPrims() - GetNumberOfPrims();
}
//-- inline version of the previous
((llGetNumberOfPrims() - llGetObjectPrimCount( llGetKey() )) * !llGetAttached())