I've been making some debounce things with some scripts I've been using and I was wondering if It's possible to make a wait function go on for infinity so the script won't look messy. For an example:
db = true script.Parent.MouseClick:connect(function() if db == true then db = false -- do stuff end wait(9999999999999999) -- until can be pressed again db = true end)
Obviously, I don't need a wait longer than that but my point is, is there any possible way to make a wait run forever without having to have it be "999999999999999999" It makes the script look messy.
A debounce is not what you need for this. :) What you need is to disable the script after it has been activated.
db = true script.Parent.MouseClick:connect(function() if db == true then db = false -- do stuff end end)
I'm not very good with scripting but I believe this eliminates the possibility of it becoming enabled again, because db stays false. I hope i'm right about this but i'm just using logic. :b