LlGetNumberOfPrims: Difference between revisions
Appearance
Osgridadmin (talk | contribs) Created page with "==Function: integer llGetNumberOfSides( );== Returns an integer that is the number of faces (or sides) of the prim. <br><br> See Face for more information about faces and the..." |
Osgridadmin (talk | contribs) No edit summary |
||
| Line 1: | Line 1: | ||
==Function: integer | ==Function: integer llGetNumberOfPrims( );== | ||
Returns an integer that is the number of | Returns an integer that is the number of prims in a link set the script is attached to. <br> <br> | ||
'''Caveats''' <br> | |||
'''Examples'''<br> | • The number of prims returned includes the count of avatars sitting on the object. <br> <br> | ||
'''Examples''' <br> | |||
{|border="1" cellpadding="5" cellspacing="0" | {|border="1" cellpadding="5" cellspacing="0" | ||
|<source lang="lsl"> | |<source lang="lsl"> | ||
| Line 9: | Line 10: | ||
state_entry() | state_entry() | ||
{ | { | ||
llOwnerSay((string) llGetLinkNumber()); | |||
llOwnerSay((string) llGetNumberOfPrims()); | |||
} | } | ||
} | |||
Useful Snippets | |||
//Returns the number of agents on the object | |||
integer GetNumberOfAgents() | |||
{//count avatars | |||
return llGetNumberOfPrims() - llGetObjectPrimCount(llGetKey()); | |||
} | |||
//Returns the number of prims in the object | |||
integer GetNumberOfPrims() | |||
{//ignores avatars | |||
return llGetObjectPrimCount(llGetKey()); | |||
} | } | ||
</source> | </source> | ||
|} | |} | ||
<br> | |||
See Also <br> | |||
'''Functions''' <br> | |||
• [[llGetObjectPrimCount]] – Returns the number of prims in any object. <br> | |||
• [[llGetLinkNumber]] – Returns the link number of the prim the script is in. <br> <br> | |||
Latest revision as of 22:44, 31 December 2017
Function: integer llGetNumberOfPrims( );
Returns an integer that is the number of prims in a link set the script is attached to.
Caveats
• The number of prims returned includes the count of avatars sitting on the object.
Examples
| <source lang="lsl">
default { state_entry()
{
llOwnerSay((string) llGetLinkNumber());
llOwnerSay((string) llGetNumberOfPrims());
}
} Useful Snippets //Returns the number of agents on the object integer GetNumberOfAgents() {//count avatars return llGetNumberOfPrims() - llGetObjectPrimCount(llGetKey()); } //Returns the number of prims in the object integer GetNumberOfPrims() {//ignores avatars return llGetObjectPrimCount(llGetKey()); } </source> |
See Also
Functions
• llGetObjectPrimCount – Returns the number of prims in any object.
• llGetLinkNumber – Returns the link number of the prim the script is in.