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

ClickDetector is not a member of ClickDetector?

Asked by 5 years ago

So basically I have a script where you click on a plank and it falls down, makes a noise, and then dissappears but then, I get an error stating that ClickDetector is not a member or ClickDetector I checked my script and tried to find a fix but I could just not do it. Anything that could help?

local PlankBreak = script.Parent.ClickDetector

PlankBreak.MouseClick:Connect(function()

script.Parent.Parent.Anchored = false

script.Parent.Parent.Break:Play()

wait(3)

script.Parent.Parent:Destroy()

end)()

0
MouseClick1 ???? retrobricks 162 — 5y
0
is the script inside the click detector? If so you don't need .ClickDetector just script.Parent hellmatic 1523 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Your script is inside the ClickDetector. Instead of using 'script.Parent.ClickDetector', use 'script.Parent'.

Ad

Answer this question