Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Where and can this local debounce script work?

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

1 answer

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.)

2 comments

0

Didn't work

0

What's your way of activating the button?

This discussion is preserved as it was. New answers, comments, and votes are closed.