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

How do I use a ClickDetector properly?

Asked by 10 years ago

This is what I tried:

function onClicked(player)
    script.Parent.Parent.Parent.Gate.Transparency = 0.9
    script.Parent.Parent.Parent.Gate.CanCollide = false
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)

Thanks in advance for your help!

0
What seems to be the problem? Redbullusa 1580 — 10y

1 answer

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
10 years ago

There's nothing wrong with your script in it's current state. Either you're not indexing the 'Gate' properly or you're using a localscript.

Make this a Script if it's a LocalScript

Check your parenting.

0
I switched it over to a normal script and it still doesn't work. SchonATL 15 — 10y
0
Okay then where is the script's parent? Goulstem 8144 — 10y
Ad

Answer this question