Of course I can assign a variable that counts up every time a button is pressed. And that, was my attempt. But I realized that that is definitely not reliable at all.
local debounce = false;
local count = 0;
local function Func()
if debounce then return end;
debounce = true
--Code Here
wait()
count = count + 1;
debounce = false;
end;
Func();
The thing is that, I am creating, basically a shop gui. There are two buttons; Previous and Next. There are quite a lot of frames and every time I press either button, I want the frame to either move away from screen or into the screen. I have created it fully, but the thing is that I use Numbers to check whether a frame is in the screen or not. I realized that if a person spam clicks the button, the number vanishes, or better, it moves up and down very quickly. Thus, the frames do not follow the algorithm.
I also implemented Debounce but that does not work if a function is short and If I did not want it to wait at all.
I think the most reliable source would be boolean but I do not know how to implement that on the code. Is there a better technique? Or am i just using the debounce wrong?
Your help would be appreciated. I have not included my frame code but will if you would like for me to do so, I can.
[EDIT[ Sparkevin had suggested me to use IntValue but that did not work either.

3 comments
Have you tried adding an IntValue within the Gui or script to keep track?
Sorry a bit confused. So your problem is that your debounce wont work?
^ Yee