Script not working

Hello, I am making ELS and I know this isn’t the best way but yk.

local WaitTime = 0.075
local Lightbar = script.Parent.Parent.Lights
local Values = script.Parent.Parent.Values

local Colors = {
[1] = Color3.fromRGB(69, 120, 202),
[2] = Color3.fromRGB(202, 78, 78),
[3] = Color3.fromRGB(218, 133, 65),
[4] = Color3.fromRGB(255, 255, 255),
}
local function light(light, color)
if color == 0 then
for i,v in pairs(Lightbar[light]:GetDescendants()) do
if v:IsA(“GuiObject”) then
v.Visible = true
elseif v:IsA(“SurfaceGui”) or v:IsA(“Light”) then
v.Enabled = false
end
end
Lightbar[light].Transparency = 1
Lightbar[light].Material = “SmoothPlastic”
else
for i,v in pairs(Lightbar[light]:GetDescendants()) do
if v:IsA(“ImageLabel”) or v:IsA(“ImageButton”) then
v.ImageColor3 = Colors[color]
v.Visible = true
elseif v:IsA(“Light”) then
v.Color = Colors[color]
v.Enabled = true
elseif v:IsA(“SurfaceGui”) then
v.Enabled = true
end
end
Lightbar[light].Color = Colors[color]
Lightbar[light].Transparency = 0
Lightbar[light].Material = “Neon”
end
end
spawn(function()
while true do
wait(WaitTime)
if Values.FrontBlue.Value == true then
light(“lb_1”, 1)
light(“lb_2”, 4)
light(“lb_5”, 1)
light(“Mixed”, 1)
light(“rb_7”, 1)
light(“rb_8”, 1)
wait(WaitTime)
light(“lb_1”, 0)
light(“lb_5”, 0)
light(“rb_7”, 0)
light(“rb_8”, 0)
wait(WaitTime)
light(“lb_1”, 1)
light(“lb_5”, 1)
light(“rb_7”, 1)
light(“rb_8”, 1)
wait(WaitTime)
light(“lb_1”, 0)
light(“lb_5”, 0)
light(“rb_7”, 0)
light(“rb_8”, 0)
wait(WaitTime)
light(“lb_1”, 1)
light(“lb_5”, 1)
light(“rb_7”, 1)
light(“rb_8”, 1)
wait(WaitTime)
light(“lb_1”, 0)
light(“lb_5”, 0)
light(“rb_7”, 0)
light(“rb_8”, 0)
wait(WaitTime)
light(“lb_1”, 1)
light(“lb_5”, 1)
light(“rb_7”, 1)
light(“rb_8”, 1)
wait(WaitTime)
light(“lb_1”, 0)
light(“lb_2”, 0)
light(“lb_5”, 0)
light(“rb_7”, 0)
light(“rb_8”, 0)
wait(WaitTime)

light(“rb_9”, 4)
light(“rb_10”, 1)
light(“lb_3”, 1)
light(“lb_4”, 1)
light(“rb_6”, 1)
wait(WaitTime)

light(“rb_10”, 0)
light(“lb_3”, 0)
light(“lb_4”, 0)
light(“rb_6”, 0)
wait(WaitTime)

light(“rb_10”, 1)
light(“lb_3”, 1)
light(“lb_4”, 1)
light(“rb_6”, 1)
wait(WaitTime)

light(“rb_10”, 0)
light(“lb_3”, 0)
light(“lb_4”, 0)
light(“rb_6”, 0)
wait(WaitTime)

light(“rb_10”, 1)
light(“lb_3”, 1)
light(“lb_4”, 1)
light(“rb_6”, 1)
wait(WaitTime)

light(“rb_10”, 0)
light(“lb_3”, 0)
light(“lb_4”, 0)
light(“rb_6”, 0)
wait(WaitTime)

light(“rb_10”, 1)
light(“lb_3”, 1)
light(“lb_4”, 1)
light(“rb_6”, 0)
wait(WaitTime)

light(“rb_9”, 0)
light(“rb_10”, 0)
light(“lb_3”, 0)
light(“lb_4”, 0)
light(“rb_6”, 0)
wait(WaitTime)

else

  light("lb_1", 0)
  light("lb_2", 0)
  light("lb_5", 0)
  light("Mixed", 0)
  light("rb_7", 0)
  light("rb_8", 0)
  light("rb_9", 0)
  light("rb_10", 0)
  light("lb_3", 0)
  light("lb_4", 0)
  light("rb_6", 0)
  end

end
end)

The Value Works Fine, I am about to try printing on different sections now

Any Ideas

Oh sorry Il try now

local WaitTime = 0.075
local Lightbar = script.Parent.Parent.Lights
local Values = script.Parent.Parent.Values

local Colors = {
	[1] = Color3.fromRGB(69, 120, 202),
	[2] = Color3.fromRGB(202, 78, 78),
	[3] = Color3.fromRGB(218, 133, 65),
	[4] = Color3.fromRGB(255, 255, 255),
}
local function light(light, color)
	if color == 0 then
		for i,v in pairs(Lightbar[light]:GetDescendants()) do
			if v:IsA("GuiObject") then
				v.Visible = true
			elseif v:IsA("SurfaceGui") or v:IsA("Light") then
				v.Enabled = false
			end
		end
		Lightbar[light].Transparency = 1
		Lightbar[light].Material = "SmoothPlastic"
	else
		for i,v in pairs(Lightbar[light]:GetDescendants()) do
			if v:IsA("ImageLabel") or v:IsA("ImageButton") then
				v.ImageColor3 = Colors[color]
				v.Visible = true
			elseif v:IsA("Light") then
				v.Color = Colors[color]
				v.Enabled = true
			elseif v:IsA("SurfaceGui") then
				v.Enabled = true
			end
		end
		Lightbar[light].Color = Colors[color]
		Lightbar[light].Transparency = 0
		Lightbar[light].Material = "Neon"
	end
end
spawn(function()
while true do
	wait(WaitTime)
	if Values.FrontBlue.Value == true then
	light("lb_1", 1)
	light("lb_2", 4)
	light("lb_5", 1)
	light("Mixed", 1)
	light("rb_7", 1)
	light("rb_8", 1)
	wait(WaitTime)
	light("lb_1", 0)
	light("lb_5", 0)
	light("rb_7", 0)
	light("rb_8", 0)
	wait(WaitTime)
	light("lb_1", 1)
	light("lb_5", 1)
	light("rb_7", 1)
	light("rb_8", 1)
	wait(WaitTime)
	light("lb_1", 0)
	light("lb_5", 0)
	light("rb_7", 0)
	light("rb_8", 0)
	wait(WaitTime)
	light("lb_1", 1)
	light("lb_5", 1)
	light("rb_7", 1)
	light("rb_8", 1)
	wait(WaitTime)
	light("lb_1", 0)
	light("lb_5", 0)
	light("rb_7", 0)
	light("rb_8", 0)
	wait(WaitTime)
	light("lb_1", 1)
	light("lb_5", 1)
	light("rb_7", 1)
	light("rb_8", 1)
	wait(WaitTime)
	light("lb_1", 0)
	light("lb_2", 0)
	light("lb_5", 0)
	light("rb_7", 0)
	light("rb_8", 0)
	wait(WaitTime)
	------------------
	light("rb_9", 4)
	light("rb_10", 1)
	light("lb_3", 1)
	light("lb_4", 1)
	light("rb_6", 1)
	wait(WaitTime)

	light("rb_10", 0)
	light("lb_3", 0)
	light("lb_4", 0)
	light("rb_6", 0)
	wait(WaitTime)

	light("rb_10", 1)
	light("lb_3", 1)
	light("lb_4", 1)
	light("rb_6", 1)
	wait(WaitTime)

	light("rb_10", 0)
	light("lb_3", 0)
	light("lb_4", 0)
	light("rb_6", 0)
	wait(WaitTime)

	light("rb_10", 1)
	light("lb_3", 1)
	light("lb_4", 1)
	light("rb_6", 1)
	wait(WaitTime)

	light("rb_10", 0)
	light("lb_3", 0)
	light("lb_4", 0)
	light("rb_6", 0)
	wait(WaitTime)
	
	light("rb_10", 1)
	light("lb_3", 1)
	light("lb_4", 1)
	light("rb_6", 0)
	wait(WaitTime)

	light("rb_9", 0)
	light("rb_10", 0)
	light("lb_3", 0)
	light("lb_4", 0)
	light("rb_6", 0)
		wait(WaitTime)
		
	else
		
		light("lb_1", 0)
		light("lb_2", 0)
		light("lb_5", 0)
		light("Mixed", 0)
		light("rb_7", 0)
		light("rb_8", 0)
		light("rb_9", 0)
		light("rb_10", 0)
		light("lb_3", 0)
		light("lb_4", 0)
		light("rb_6", 0)
		end
	end
end)


And what is ELS? Could you elaborate on what you are trying to do and what exactly isn’t working? Are there any errors appearing in the output?

It Makes the Part Transparent and covers that under the function light but at the top, I am currently testing with printing

No Errors, Testing Prints so Il have a result from that

By looking at your script, it’s very long so I’m sure there can be some optimisations done to all this.

It Prints that the value is off even though it is on

Ye Its like a Plugin that scripts it for me