Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How the clickdetector work?

I still not learn anything about ClickDetector,I try basic script and it wont work

I watch on youtube how to do it but i still don't know the basic

This the script that i try

script.Parent.Parent.BrickColor = BrickColor.new("Baby blue")function Myfunction() workspace.Part.ClickDetector.MouseClick:Connect(Myfunction()

and the output give me this

Workspace.Part.ClickDetector.Script:4: ')' expected (to close '(' at line 2) near ''

1 answer

✓ Accepted answer
-- I will organize this for you...

workspace.Part.ClickDetector.MouseClick:Connect(function()
	script.Parent.Parent.BrickColor = BrickColor.new("Baby blue")
end)

I got rid of the function and replaced it with an event.. I put the script to change the brick color in the event

This discussion is preserved as it was. New answers, comments, and votes are closed.