General
Button to Toggle Script Utilization of Fader
Started by SBPBK on .
Sign in or create an account to join the conversation.
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
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
try to begin your script, that you want to toggle, with:
if(Switches.x==1) return;
...
So if the switch is on, the rest of the script won't be executed.brilliant, exactly what I needed. thank you so much!! 