Button not changing color.. why?

script.Parent.MouseButton1Down.Connect(function()
	script.Parent.Parent.Parent.Parent.Buttons.General.BackgroundColor3 = Color3.fromRGB(230, 230, 230)
end)

Hi everyone! I have been trying to make a button that changes the colour of another button. I inputed the same exact spot the button is located which is
script.Parent.Parent.Parent.Parent.Buttons.General and still, it did not change the background colour… Any help please? (I am new to scripting, it might be a really dumb mistake.)

What type of script is are you using?

Edit: Wow how did I not see that mistake, thanks for pointing that out for both me and @OP @xZylter

LocalScript. Assuming it’s for one person only.

script.Parent.MouseButton1Down.Connect(function()

You need to use a colon before Connect, so it should be [EventName]:Connect.

3 Likes

Oh my god. Thank you so much. I feel like such an idiot. Sorry for the waste of time.

1 Like