RandomPrimParams

From Second Life Wiki
Revision as of 16:42, 24 January 2015 by ObviousAltIsObvious Resident (talk | contribs) (<lsl> tag to <source>)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Simple script to show how to set random primitive parameters.

default
{
    state_entry()
    {
        // set timer to go off every other 5.0 seconds
        llSetTimerEvent(5.0);
    }

    timer()
    {
        vector color = <llFrand(1.0), llFrand(1.0), llFrand(1.0)>;

        // set random color on all sides of linkset with opaque as alpha value
        llSetLinkPrimitiveParamsFast(LINK_SET,
            [PRIM_COLOR, ALL_SIDES, color, (float)TRUE]);
    }
}