Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
bugs01 5
9 years ago
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)
0
Errors? What part isn't working? What have you tried to fix it? YellowoTide 1992 — 9y
0
It says "Unable to create an Instance of type "Clickdetector"" bugs01 5 — 9y
0
Also, destroy wont work either. Destroy will. unmiss 337 — 9y
0
If it's answered hit 'accept answer' next to said answer. Goulstem 8144 — 9y

1 answer

Log in to vote
1
Answered by
unmiss 337 Moderation Voter
9 years ago

Clickdetector isn't an instance, so it won't be created... but, ClickDetector is!

Remember, Lua is almost always case-sensitive.

0
ahhhh Thank you very much :) bugs01 5 — 9y
0
Another question, After it creates it the script that plays sound dosent loop. Any help there? bugs01 5 — 9y
3
Remember, if a answer solves the problem, hit the Accept Answer button to the right of this comment. >   M39a9am3R 3210 — 9y
0
Post another question or edit it for that one. Make sure to accept answers as well. unmiss 337 — 9y
Ad

Answer this question