I wrote a script to turn a value off for a while and then turn it back on, but it doesn't seem to be working. I have analyzed every line and I cannot find the error. Please help.
debounce = false
function OnClicked(player)
if debounce == false then
debounce = true
if player.TeamColor == script.Parent.Parent.Parent.Parent.Parent.TeamColor.Value then
wait(0.1)
script.Parent.BrickColor = BrickColor.new("Really black")
script.Parent.Parent.Running.Value = false
wait(119.9)
script.Parent.BrickColor = BrickColor.new("Dark indigo")
script.Parent.Parent.Running.Value = true
debounce = false
end
end
end
script.Parent.ClickDetector.MouseClick:connect(OnClicked)
Nothing appears in output at all.

2 comments
Please tab your code. This is almost unreadable.
Is filtering enabled on? If so, click detectors act really weird. Try printing the player variable after line three. If it prints nil than that's your problem.