Hello. I am wondering, how do you make a function that activates and deactivates a function? The 1st Function's name is turnOn and the 2nd Function is named turnOff. -- If you can add how to stop the function when another function is still in action, it would help me a lot.
✓ ANSWER ACCEPTED
How do you make a function that activates and deactivates another function?
1 answer
✓ Accepted answer
function1enabled = true
function2enabled = true
function function1()
if function1enabled == true then -- checks to see if this function has been turned off
function2enabled = false -- this turns off the second function
-- do stuff here
end
end
function function2()
if function2enabled == true then -- checks to see if this function has been turned off
function1enabled = false -- turns off the first function
-- do stuff here asdfadsadsf
end
end
Something like that?
This discussion is preserved as it was. New answers, comments, and votes are closed.
