I have tried making a click detector cooldown but what it does is just remove the clickdetector then after a few seconds it breaks the script.
COMMUNITY QUESTION
Is it possible to make a clickdetector cooldown?
1 answer
You could add a debounce to the script.
local part = game.Workspace.Part
local clickDetector = part.ClickDetector
local canClick = true
local clickTime = 5 --Time in seconds
local function onMouseClick(player)
if canClick then
part.BrickColor = BrickColor.Random()
canClick = false
wait(clickTime)
canClick = true
end
end
clickDetector.MouseClick:Connect(onMouseClick)
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
It’s BrickColor.Random(), not random(). And it’s Connect, not connect. Please stop giving users old, broken deprecated code.
Ive always used "connect" I've never had any problems ???
It lags and delays.
I just took it from the wiki
eat a dick
Mind you language BaconOofIsBest