So I'm trying to make a machine that can do several things, but only one at a time. I created a debounce using a boolvalue
All the scripts look generally like this (except the strings are different):
debounce = script.Parent.Value.Value
function tch(h)
if not debounce then
debounce = true
else return end
if (h.Parent.Name == "Espresso Beans") then
script.Parent.Parent.Beans1.Transparency = 0
script.Parent.Grind:Play()
wait(1)
script.Parent.Parent.Beans1.Transparency = 1
script.Parent.Parent.Beans2.Transparency = 0
wait(1)
script.Parent.Parent.Beans2.Transparency = 1
script.Parent.Parent.Beans3.Transparency = 0
wait(1)
script.Parent.Parent.Beans3.Transparency = 1
h.Parent.Name = "Espresso Roast"
debounce = false
end end
script.Parent.Touched:connect(tch)
I can run only one of the scripts only once, but after that they are all rendered useless (by the debounce) If I remove the debounce completely, it works.(But without the effects of the debounce that I want.) And when I test it, it doesn't give me an error. So my guess is that* line 19* is not doing what it's supposed to for some reason, please help me out.

3 comments
It's having the same issue as before. :(
What exactly is going wrong then? This should work...
It has something to do with the other scripts, when I use one of them, I can re-use that one as much as I want, but the other ones are completely useless after that. When I try to use the other ones it turns the value to true but doesn't go through the rest of the script.