Rainbow palette

From Second Life Wiki
Revision as of 17:59, 26 September 2008 by Rui Clary (Talk | contribs)

Jump to: navigation, search

<lsl> // Rainbow Palette by Rui Clary // This script will only run in Mono enabled, Second Life Viewer 1.21 or above. // // Interactive Rainbow Palette // // Add this script to a cube prim and add "Listen Palete" script to another Object. // You can resize and stretch the cube, the way you want, to make it look like a color palette. // Touch face 1 of "Rainbow Palette" to change "Listen Object" color. // // Available under the Creative Commons Attribution-ShareAlike 3.0 license // http://creativecommons.org/licenses/by-sa/3.0/

default {

       llSetTexture ("5748decc-f629-461c-9a36-a35a221fe21f",ALL_SIDES);
   touch(integer num_detected) 
       float x;
       float r;
       float g;
       float b;
        vector touchedpos = llDetectedTouchST(0);  
        if (llDetectedTouchFace(0)==1)
           if (x>=0&&x<=60)
           if (x>=300&&x<=360)
           if (x>=120&&x<=240)
           if (x>60&&x<=120)
           if (x>240&&x<300)
           if (x>=0&&x<60)
           if (x>=60&&x<=180)
           if (x>180&&x<240)
           if (x>=240&&x<=360)
           if (x>=0&&x<=120)
           if (x>120&&x<180)
           if (x>=180&&x<=300)
           if (x>300&&x<=360)



<lsl> // Rainbow Palette Listen Script by Rui Clary // // Second component of Rainbow Palette // // Add this script to "Listen Object".

default {

       llListen( 4, "pal", NULL_KEY, "" ); 
  listen( integer channel, string name, key id, string message )

} </lsl>