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)
✓ ANSWER ACCEPTED
Sorry for a second post i deleted the last, Why isnt this script working? [Answered]
1 answer
✓ Accepted answer
Clickdetector isn't an instance, so it won't be created... but, ClickDetector is!
Remember, Lua is almost always case-sensitive.
4 comments
0
ahhhh Thank you very much :)
0
Another question, After it creates it the script that plays sound dosent loop. Any help there?
3
Remember, if a answer solves the problem, hit the Accept Answer button to the right of this comment. >
0
Post another question or edit it for that one. Make sure to accept answers as well.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
Errors? What part isn't working? What have you tried to fix it?
It says "Unable to create an Instance of type "Clickdetector""
Also, destroy wont work either. Destroy will.
If it's answered hit 'accept answer' next to said answer.