if script.Parent.MouseButton1Click:Connect(onClicked)then workspace.Part.Transparency = 0.5 end
what did I do wrong in this code
To connect an event to a part, you don't need to use an if statement, you simply take out the if and then and add an end)
. You will also need to add a click detector and connect the MouseClick
to that instead. That would make your script look like this:
script.Parent.ClickDetector.MouseClick:Connect(function() -- I also took the onClicked out, as you don't need it. workspace.Part.Transparency = 0.5 end)
Hope I helped.