Don't click here unless you want to be banned.

LSL Wiki : llGetNumberOfPrims

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawling22.us.archive.org
integer llGetNumberOfPrims()

Returns the number of prims in (and avatars seated on) the object the script is in.

Note: this function works regardless of whether the script is in the parent or a child prim in a linked set.

//Returns the number of agents on the object
integer GetNumberOfAgents()
{//ignores avatars.
    integer a = llGetNumberOfPrims();
    integer b = a;
    if(1 < a)
        while(llGetAgentSize(llGetLinkKey(a)))
            --a;
    return b - a;
}

//Returns the number of prims in the object
integer GetNumberOfPrims()
{//ignores avatars.
    integer a = llGetNumberOfPrims();
    if(1 < a)
        while(llGetAgentSize(llGetLinkKey(a)))
            --a;
    return a;
}


Functions | Object | Prim | Link
Comments [Hide comments/form]
Attach a comment to this page: