Jump to content
  • 0

How do I make a color changing script with an on and off option


MistressNocturne
 Share

You are about to reply to a thread that has been inactive for 4224 days.

Please take a moment to consider if this thread is worth bumping.

Question

Not sure if this is the right place to post this,  but I wanted to know if it was possible to have a color changing light script that can be turned on an off instead of being on forever.

I hope that makes sense, Scripting isn't my greatest talent.

(EDIT)

Okay thank you everyone below!! But I wasn't too clear.

I have a script where it makes the prim light up and cylce through different colors. I want to have a script to make it turn on and off. I have tried to do this myself but I can't seem to make it work. I always have an error show up. Any suggestions?

 

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

The following example shows how to create a configurable light that turns itself on and off when touched. The light's properties can be edited by changing the values defined at the top of the script. This script illustrates the lighting attributes PRIM_POINT_LIGHT, PRIM_FULLBRIGHT and PRIM_GLOW.

// Touch the object to light it up.// Lighting is configurable. integer light_s = TRUE;vector lightcolor = <1.0, 0.75, 0.5>;float intensity = 1.0; // 0-1float radius = 10.0;   // 0-10float falloff = 0.0;   // 0-1float glow = 1.0; switchit(){    float thisglow = 0.0;    light_s = !light_s;    if (light_s)    {        thisglow = glow;    }    llSetPrimitiveParams([        PRIM_POINT_LIGHT, light_s, lightcolor, intensity, radius, falloff,        PRIM_FULLBRIGHT, ALL_SIDES, light_s,        PRIM_GLOW, ALL_SIDES, thisglow    ]);      llSetColor(lightcolor, ALL_SIDES);} default{    state_entry()    {      llSetText("Touch for light",<0,0,0>,1);      switchit();    }     touch_start(integer total_number)    {        switchit();    }}

 You can find lots of script help @ http://wiki.secondlife.com/wiki/LSL_Portal

Link to comment
Share on other sites

  • 0

Yes, that's quite possible, and it's a nice scripting challenge for a new scripter.  If you are not feeling confident enough to write it yourself, you can try this one, or modify it...

http://community.secondlife.com/t5/LSL-Library/Light-controller/m-p/1322741#M411

Just change the color values for the variables that Alicia calls lColorOff and lColorOn to whatever hues please you.

Link to comment
Share on other sites

  • 0

Thank you for adding the extra information.  It should be quite easy, but it's almost impossible to answer without seeing the script itself.  That's exactly what the LSL Scripting forum is here for.  It is designed as a place for scripters to share ideas and problems.  So, start a new thread over there and paste your script into it.  We'll be glad to help.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4224 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...