Change colors of a light then revert them back to the original color

So, I’m trying to create a lighting script and I have these different colored lights, I want all of them to turn off and go black, then when reactivated they will revert back to their original colors.

How do I achieve this?

1 Like

You could simply have a variable for the original colors and when you turn off the light it becomes black and when you put it back on it sets it to the variable that you’ve set.

you can simply:
function TurnLightOn_Off(Value)
	if Value then -- Light is on
		-- do whatever u wn
	else -- Light is Off
		-- do whatever u wn
	end
end

TurnLightOn_Off(false) -- turn the lights off
TurnLightOn_Off(true) -- turn the lights On

That’s just the light thing, I want the light’s brick colors and the light object’s colors to revert to their original colors when the lights turn on.

You can just store the original values:

local originalLightColor = script.Parent.Color -- store original color

script.Parent.Color = Color3.new(1,1,1) -- change color

script.Parent.Color = originalLightColor -- set back to the original

If you show the code you’re using I can probably explain it better.

This actually worked, Thanks alot!

1 Like