I don't know anything about scripting, but i know enough to try and make a button panel that simply switches two lights, one red, one green, on and off, with some other information gathering for later use.
I've built the panel, the lights, and the button. Here is the code.
local Green = game.workspace.Console.lights.Green
local Red = game.workspace.Console.lights.Red
function Star()
if Green.BrickColor.Name == "Earth Green"
then
script.parent.parent.parent.lights.Green.BrickColor = BrickColor.new(0,1,0)
script.parent.parent.parent.lights.Red.BrickColor = BrickColor.new(0.8,0.3,0.3)
script.parent.parent.parent.lights.Red.Material = "SmoothPlastic"
script.button.Position = "4.1, 3.533, -3.966"
end
if Green.BrickColor.Name == "Lime Green"
then
script.parent.parent.parent.lights.Green.BrickColor = BrickColor.new(0.4,0.7,0.4)
script.parent.parent.parent.lights.Red.BrickColor = BrickColor.new(1,0,0)
script.parent.parent.parent.lights.Red.Material = "SmoothPlastic"
script.button.Position = "4.1, 3.56, -3.953"
end
end
script.Parent.ClickDetector.MouseClick:connect(Star)
For some reason, pressing the button no longer gives me any output. I have no information on what exactly is wrong here, so any assistance would be cool. thanks.

2 comments
You can unless it was changed, to my knowledge, I checked this up on old threads and they support it ( https://scriptinghelpers.org/questions/66045/how-do-i-get-the-name-of-the-color-from-the-color3-value )
tried that, same result as before