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!
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.