function onClicked(playerWhoClicked) script.Parent.BrickColor = BrickColor.Green() script.Parent.Ding1b:play() script.Parent.ClickDetector:destroy() wait(3) script.Parent.BrickColor = BrickColor.Red() Instance.new("Clickdetector", game.Workspace.Doorbell) end script.Parent.ClickDetector.MouseClick:connect(onClicked)
Clickdetector isn't an instance, so it won't be created... but, ClickDetector is!
Remember, Lua is almost always case-sensitive.