if script.Parent.MouseButton1Click:Connect(onClicked)then workspace.Part.Transparency = 0.5 end
what did I do wrong in this code
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.
o n c l i c k e d i s n o t a f u n c t i o n
@Fifkee I'm aware, I blindly assumed they had it connected to a click detector so I just copy and pasted. Thanks for pointing that out though lol
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
for the onClicked
onclicked isnt a function