wait(.05)local C=script.Parent.Parent.Car.Value local K=script.Parent.Parent.Values.Brake function on()C.Body.Lights.Light.Material=Enum.Material.Neon C.Body.Lights.Light.Light.Enabled=true function off()C.Body.Lights.Light.Light.Enabled=false C.Body.Lights.Light.Material=Enum.Material.SmoothPlastic for C,K in pairs(C.Body.Lights:GetChildren())do end end end function auto()if game.Lighting:GetMinutesAfterMidnight()<390 or game.Lighting:GetMinutesAfterMidnight()>1050 then C.Body.Lights.Light.Material=Enum.Material.Neon C.Body.Lights.Light.Light.Enabled=true else C.Body.Lights.Light.Light.Enabled=false C.Body.Lights.Light.Material=Enum.Material.SmoothPlastic end end script.Parent.MouseButton1Click:connect(function()if script.Parent.Text=="\076\105\103\104\116\115\058 \065\117\116\111"then on()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 script.Parent.Text="\076\105\103\104\116\115\058 \079\102\102"off()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 C,V in pairs(C.Body.Lights:GetChildren())do if V.Name=="\082"then if V.Light.Enabled then if K.Value>0 then V.Transparency=0 V.Light.Brightness=12 V.Light.Range=15 else V.Transparency=.3 V.Light.Brightness=8 V.Light.Range=10 end else V.Transparency=0 if K.Value>0 then V.Material=Enum.Material.Neon else V.Material=Enum.Material.SmoothPlastic end end elseif V.Name=="\082\082"then if K.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.SmoothPlastic 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
function on()
		car.Body.Lights.Light.Material=Enum.Material.Neon
		car.Body.Lights.Light.Light.Enabled = true
function off()
		car.Body.Lights.Light.Light.Enabled = false
		car.Body.Lights.Light.Material=Enum.Material.SmoothPlastic
		for i,v in pairs(car.Body.Lights:GetChildren()) do
		end
end
end
function auto()
	if (game.Lighting:GetMinutesAfterMidnight()<390 or game.Lighting:GetMinutesAfterMidnight()>1050) then
		car.Body.Lights.Light.Material=Enum.Material.Neon
		car.Body.Lights.Light.Light.Enabled = true
	else
		car.Body.Lights.Light.Light.Enabled = false
		car.Body.Lights.Light.Material=Enum.Material.SmoothPlastic
	end
end

script.Parent.MouseButton1Click:connect(function()
	if script.Parent.Text == "Lights: Auto" then
		on()
		script.Parent.Text = "Lights: On"
	elseif script.parent.Text == "Lights: On" then
		script.Parent.Text = "Lights: Off"
		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 then
				if GBrake.Value>0 then
					v.Transparency=0
					v.Light.Brightness=12
					v.Light.Range=15
				else
					v.Transparency=.3
					v.Light.Brightness=8
					v.Light.Range=10
				end
			else
				v.Transparency=0
				if GBrake.Value>0 then
					v.Material=Enum.Material.Neon
				else
					v.Material=Enum.Material.SmoothPlastic
				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.SmoothPlastic
				end
			end
		end
	end
end)

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