I'm making a Gui that Tweens 2 Frames at different intervals. When the player presses the Gui activation button too fast the Frames become messed up. So I need to be able to disable the activation button for just a few moments. Any Idea on how to do that?
local Debounce, Delay = true, 5 -- Vars script.Parent.MouseButton1Click:Connect(function() if Debounce then -- Checks if boolean is true print(1) -- Our code to run Debounce = false wait(Delay) -- Delay runs Debounce = true end end)
This is called a debounce, this is very useful for many things and especially for your case here If this helps make sure to tell me! Have a great day..