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

I've been trying to create a cooldown for my tool and it won't work. What's wrong with it?

I'm trying to make a cooldown for a tool. When you activate it, the tool will disable for 5 seconds and enable after 5 seconds.

script.Parent.Equipped:Connect(function()
	script.Parent.Activated:Connect(function()
		if script.Parent.Activated then
			script.Parent.Enabled = false
			wait(5)
			script.Parent.Enabled = true
		end
	end)
end)

1 answer

local tool=script.Parent

local debounce
tool.Activated:Connect(function()
if debounce then return end;debounce=true
print("test")
wait(5)
debounce=false
end)

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