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

LSL Wiki : llGetNumberOfSides

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are
integer llGetNumberOfSides()

Returns the number of sides of the prim containing this script.

Each face of a primitive can be referenced to, from 0 to n - 1, where n is the value returned from this function. Each face can have a different texture, color, and opacity (alpha).

// Indicates number of sides using llSetText.
    changed(integer change)
        if(change & CHANGED_SHAPE)
            integer sides = llGetNumberOfSides();
            llSetText((string)sides + llList2String([" side"," sides"],(sides != 1)),<1,1,1>,1);

// this rotates the texture of each side to match its sidenumber in degrees
// after running this script, you can select each texture (using "Select Texture")
// in the edit dialog and read it's side number in the "Rotation (degrees)" field.
default {
    state_entry() {
        integer    i;
        integer    sides;
        sides = llGetNumberOfSides();
        for (i = 0; i < sides; i++) {
            llRotateTexture(i * DEG_TO_RAD, i); // rotate by side number degrees

This article wasn't helpful for you? Maybe the related article at the LSL Portal is able to bring enlightenment.

Functions | Texture | Side
There are 2 comments on this page. [Display comments/form]