when I click on the brick it does nothing. don't be amazed if there's a lot of errors I'm new.
local door = game.Workspace.door
local boi = false
local goldy = game.Workspace.gold
local sound = script.Parent.Parent:WaitForChild("Shock (A)")
local click = game.Workspace.gold.ClickDetector
click.MaxActivationDistance = 20
script.Parent.MouseClick:Connect(function()
print("clicked")
sound:Play()
door.Transparency = 0.5
door.CanCollide = false
end

3 comments
I'm sorry but I have to downvote this. You don't put a ) preceding the end because you're connecting to an event. You do it to close off the :Connect() call. You do this for any higher-order function call. The function literal body spans multiple lines, the end is part of the function. "end)" is in no way its own thing.
The answer is correct. I think you're missing the fact that he said ':Connect(function()' and not just ':Connect('
Thanks, it worked!