I made a button game that uses debounce as a cooldown before button is usable, but I also want the button to cancel the cooldown whenever this script is in workspace and I inserted this script onto workspace. However, I do not know to advanced of scripting so I need help if I need corrections on my script.
Button = script.Parent if local debounce == false then wait(10) local debounce = true Button.Material = ("Neon") end
P.S. This is a local script I put in
When you use "local" before something, it turns it into a variable. So, you need to define your debounce variable and then after that just say "debounce" without the "local" part. An example of your code with some changes:
local button = script.Parent local debounce = true if debounce == false then wait(10) debounce = true button.Material = Enum.Material.Neon end
Hope this helps! (Also, if you use a LocalScript, the changes made by it will only affect the player who fires the function. Use a regular script if you want the changes to be seen across the whole server.)