Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Sorry for a second post i deleted the last, Why isnt this script working? [Answered]

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)

4 comments

0

Errors? What part isn't working? What have you tried to fix it?

0

It says "Unable to create an Instance of type "Clickdetector""

0

Also, destroy wont work either. Destroy will.

0

If it's answered hit 'accept answer' next to said answer.

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.