wait(.05)local g=script.Parent.Parent.Car.Value local L=script.Parent.Parent.Values.Brake local m=BrickColor.new("\073\110\115\116\105\116\117\116\105\111\110\097\108 \119\104\105\116\101")local q=BrickColor.new("\068\097\114\107 \115\116\111\110\101 \103\114\101\121")function LightOn()for L,q in pairs(g.Body.Lights:GetChildren())do if q.Name=="\076\105\103\104\116"then q.BrickColor=m q.Material=Enum.Material.Neon q.Light.Enabled=true for g,L in pairs(g.Body.Lights:GetChildren())do if L.Name=="\082"then L.Material=Enum.Material.Neon L.Light.Enabled=true L.Transparency=.02 end end end end end function LightOff()for L,m in pairs(g.Body.Lights:GetChildren())do if m.Name=="\076\105\103\104\116"then m.BrickColor=q m.Material=Enum.Material.SmoothPlastic m.Light.Enabled=false for g,L in pairs(g.Body.Lights:GetChildren())do if L.Name=="\082"then L.BrickColor=BrickColor.new("\077\097\114\111\111\110")L.Material=Enum.Material.SmoothPlastic L.Light.Enabled=false L.Transparency=0 end end end end end function Auto()if game.Lighting:GetMinutesAfterMidnight()<390 or game.Lighting:GetMinutesAfterMidnight()>1050 then LightOn()else LightOff()end end script.Parent.MouseButton1Click:connect(function()if script.Parent.Text=="\076\105\103\104\116\115\058 \065\117\116\111"then LightOn()script.Parent.Text="\076\105\103\104\116\115\058 \079\110"elseif script.Parent.Text=="\076\105\103\104\116\115\058 \079\110"then LightOff()script.Parent.Text="\076\105\103\104\116\115\058 \079\102\102"elseif script.Parent.Text=="\076\105\103\104\116\115\058 \079\102\102"then Auto()script.Parent.Text="\076\105\103\104\116\115\058 \065\117\116\111"end end)script.Parent.Parent.Values.Brake.Changed:connect(function()for g,m in pairs(g.Body.Lights:GetChildren())do if m.Name=="\082"then if m.Light.Enabled==true then if L.Value>0 then m.Transparency=0 m.Light.Brightness=12 m.Light.Range=15 m.BrickColor=BrickColor.new("\082\101\097\108\108\121 \114\101\100")else m.BrickColor=BrickColor.new("\077\097\114\111\111\110")m.Material=Enum.Material.Sand m.Transparency=.02 m.Light.Brightness=8 m.Light.Range=10 end else m.Transparency=0 if L.Value>0 then m.Material=Enum.Material.Neon m.BrickColor=BrickColor.new("\082\101\097\108\108\121 \114\101\100")else m.BrickColor=BrickColor.new("\077\097\114\111\111\110")m.Material=Enum.Material.Sand end end elseif m.Name=="\082\082"then if L.Value>0 then m.Material=Enum.Material.Neon if m.Light.Enabled then m.Transparency=1 else m.Transparency=0 end else m.Transparency=1 if m.Light.Enabled then m.Material=Enum.Material.Neon else m.Material=Enum.Material.Sand end end end end end)game.Lighting.Changed:connect(Auto)Auto()

wait(0.05)
local car = script.Parent.Parent.Car.Value
local GBrake = script.Parent.Parent.Values.Brake
local lighton=BrickColor.new("Institutional white")
local lightoff=BrickColor.new("Dark stone grey")
function LightOn()
	for i,v in pairs(car.Body.Lights:GetChildren()) do
		if v.Name=="Light" then
			v.BrickColor=lighton
			v.Material=Enum.Material.Neon
			v.Light.Enabled = true
			for i,v in pairs(car.Body.Lights:GetChildren()) do
		if v.Name=="R" then
			v.Material=Enum.Material.Neon
			v.Light.Enabled = true
			v.Transparency =.02
		end
	end
		end
	end
end

function LightOff()
	for i,v in pairs(car.Body.Lights:GetChildren()) do
		if v.Name=="Light" then
			v.BrickColor=lightoff
			v.Material=Enum.Material.SmoothPlastic
			v.Light.Enabled = false
			
			for i,v in pairs(car.Body.Lights:GetChildren()) do
			if v.Name=="R" then
				v.BrickColor=BrickColor.new("Maroon")
			v.Material=Enum.Material.SmoothPlastic
			v.Light.Enabled = false
			v.Transparency =0
			end
			end
			end
			end
	end
function Auto()
	if (game.Lighting:GetMinutesAfterMidnight()<390 or game.Lighting:GetMinutesAfterMidnight()>1050) then
		LightOn()
	else
		LightOff()
		end
end
script.Parent.MouseButton1Click:connect(function()
	if script.Parent.Text=="Lights: Auto" then
		LightOn()
		script.Parent.Text = "Lights: On"
	elseif script.Parent.Text == "Lights: On" then
		LightOff()
		script.Parent.Text = "Lights: Off"
	elseif script.Parent.Text == "Lights: Off" then
		Auto()
		script.Parent.Text = "Lights: Auto"
	end
end)
script.Parent.Parent.Values.Brake.Changed:connect(function()
	for i,v in pairs(car.Body.Lights:GetChildren()) do
		if v.Name=="R" then
			if v.Light.Enabled==true then
				if GBrake.Value>0 then
					v.Transparency=0
					v.Light.Brightness=12
					v.Light.Range=15
					v.BrickColor=BrickColor.new("Really red")
				else
					v.BrickColor=BrickColor.new("Maroon")
					v.Material=Enum.Material.Sand
					v.Transparency=.02
					v.Light.Brightness=8
					v.Light.Range=10
				end
			else
				v.Transparency=0
				if GBrake.Value>0 then
					v.Material=Enum.Material.Neon
					v.BrickColor=BrickColor.new("Really red")
				else
					v.BrickColor=BrickColor.new("Maroon")
					v.Material=Enum.Material.Sand
				end
			end
		elseif v.Name=="RR" then
			if GBrake.Value>0 then
				v.Material=Enum.Material.Neon
				if v.Light.Enabled then
					v.Transparency=1
				else
					v.Transparency=0
				end
			else
				v.Transparency=1
				if v.Light.Enabled then
					v.Material=Enum.Material.Neon
				else
					v.Material=Enum.Material.Sand
				end
			end
		end
	end
end)

game.Lighting.Changed:connect(Auto)
Auto()
