Jump to content

Blinking lights script that turns off and on with touch


Glovercali
 Share

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

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

Recommended Posts

Hello, I am currently in need of some assistance. I have this script here that works great for what I need it to do, which is blink on and off with multiple faces and separate prims. I would like it to turn off and on with a touch, But cant figure out how to do that. 

they a christmas lights, the blinking is fine they turn on with touch but I of course cannot get them off with touch because I dont know how lol

here is the script -

 

default
{
    touch_start(integer num_detected)
    {
        
        llSetTimerEvent(0.5);
    }

    timer()
    {
        
        integer i = llRound(llFrand(1.5));
        llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_FULLBRIGHT, 2,i, PRIM_GLOW, 2, 0.15*i]);
        i = llRound(llFrand(1.5));
        llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_FULLBRIGHT, 4, i, PRIM_GLOW,4, 0.15*i]);
        i = llRound(llFrand(1.5));
        llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_FULLBRIGHT, 3, i, PRIM_GLOW,3, 0.15*i]);
      
        llSetLinkPrimitiveParamsFast(10,[PRIM_FULLBRIGHT, 2, i, PRIM_GLOW,2, 0.15*i]);
i = llRound(llFrand(1.5));
        llSetLinkPrimitiveParamsFast(10,[PRIM_FULLBRIGHT, 1, i, PRIM_GLOW,1, 0.15*i]);


    }
}
  

Link to comment
Share on other sites

Hi Quistess! Thank you for the speedy response!

The script turned the blinking off but it didn't turn the fullbright off and glow off. How would I implement that in this script?

Thank you in advance!

 


integer isOn;
default
{
    touch_start(integer num_detected)
    {   
        llSetTimerEvent(0.5*(isOn=!isOn));
    }
    timer()
    { 
        
        integer i = llRound(llFrand(1.5));
        llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_FULLBRIGHT, 2,i, PRIM_GLOW, 2, 0.15*i]);
        i = llRound(llFrand(1.5));
        llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_FULLBRIGHT, 4, i, PRIM_GLOW,4, 0.15*i]);
        i = llRound(llFrand(1.5));
        llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_FULLBRIGHT, 3, i, PRIM_GLOW,3, 0.15*i]);
      
        llSetLinkPrimitiveParamsFast(10,[PRIM_FULLBRIGHT, 2, i, PRIM_GLOW,2, 0.15*i]);
i = llRound(llFrand(1.5));
        llSetLinkPrimitiveParamsFast(10,[PRIM_FULLBRIGHT, 1, i, PRIM_GLOW,1, 0.15*i]);


    }
}
    
 

Edited by Glovercali
Link to comment
Share on other sites

2 hours ago, Glovercali said:

turn the fullbright off and glow off.

integer isOn;
set_params()
{       integer i = llRound(llFrand(1.5))*isOn;
        llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_FULLBRIGHT, 2,i, PRIM_GLOW, 2, 0.15*i]);
        i = llRound(llFrand(1.5))*isOn;
        llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_FULLBRIGHT, 4, i, PRIM_GLOW,4, 0.15*i]);
        i = llRound(llFrand(1.5))*isOn;
        llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_FULLBRIGHT, 3, i, PRIM_GLOW,3, 0.15*i]);
      
        llSetLinkPrimitiveParamsFast(10,[PRIM_FULLBRIGHT, 2, i, PRIM_GLOW,2, 0.15*i]);
        i = llRound(llFrand(1.5))*isOn;
        llSetLinkPrimitiveParamsFast(10,[PRIM_FULLBRIGHT, 1, i, PRIM_GLOW,1, 0.15*i]);
}
default
{
    touch_start(integer num_detected)
    {   llSetTimerEvent(0.5*(isOn=!isOn));
        set_params();
    }
    timer()
    {   set_params();
    }
}

would probably work.

  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 465 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...