I am making a script that will, when the surface gui button is clicked, changes the color of the brick to red, and makes it neon, but it will not work. here is the script :
TextButton.MouseButton1Click:connect(function() script.Parent.Parent.Light1.BrickColor = BrickColor.new("Really red") wait(0.1) script.Parent.Parent.Light1.Material = Material.new("Neon") end)
If you could tell me what I'm doing wrong, i would be really happy to find out.

4 comments
“Material.new” doesn’t exist I think, and is the SurfaceGui parented to StarterGui/PlayerGui and does it have an adornee set in its properties?
Also, it would be helpful if you could turn the code you are attempting to show us into a code block, so it is easier to read.
http://prntscr.com/k7t04e @denny
^ The button won’t work if it’s parented in a part. You’ll have to put it in StarterGui and set the adornee to the part. The button should then work, except now you’ll have to use remote events. :P