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