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
8 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 — 8y
0
It says "Unable to create an Instance of type "Clickdetector"" bugs01 5 — 8y
0
Also, destroy wont work either. Destroy will. unmiss 337 — 8y
0
If it's answered hit 'accept answer' next to said answer. Goulstem 8144 — 8y

1 answer

Log in to vote
1
Answered by
unmiss 337 Moderation Voter
8 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 — 8y
0
Another question, After it creates it the script that plays sound dosent loop. Any help there? bugs01 5 — 8y
3
Remember, if a answer solves the problem, hit the Accept Answer button to the right of this comment. >   M39a9am3R 3210 — 8y
0
Post another question or edit it for that one. Make sure to accept answers as well. unmiss 337 — 8y
Ad

Answer this question