Page 1 of 1

Button to Toggle Script Utilization of Fader

Posted: 27 Sep 2013 09:09
by SBPBK
Hi!

I'm trying to write a script (conditional statement) to have a button toggle on/off a fader's use of a separate script.

Since the fader script that I want to toggle on/off is itself a conditional statement, I am a little confused as how to write that conditional statement within the conditional statement that will handle toggling the script on/off dependent on the button's state.

The fader script which I need to toggle on/off is:

if (z==0) x=0;

So, to be clear, what I am trying to figure out is something along the lines of:

if button.x=127 then {if (Fader.z==0) Fader.x=0;} else nothing happens

I have tried a few different ways of writing it but to no avail.. Any help or guidance would be much appreciated!!

Cheers

Re: Button to Toggle Script Utilization of Fader

Posted: 27 Sep 2013 12:17
by Phil999
try to begin your script, that you want to toggle, with:

Code: Select all

if(Switches.x==1) return;
...
So if the switch is on, the rest of the script won't be executed.

Re: Button to Toggle Script Utilization of Fader

Posted: 27 Sep 2013 12:58
by SBPBK
brilliant, exactly what I needed. thank you so much!! :mrgreen: