wait(.05)local z=script.Parent.Parent.Car.Value local p=script.Parent.Parent.Values.Brake function on()z.Body.Lights.RN.BrickColor=BrickColor.New("\077\097\114\111\111\110")z.Body.Lights.RN.Material=Enum.Material.Neon z.Body.Lights.Light.Material=Enum.Material.Neon z.Body.Lights.Light.Light.Enabled=true z.Body.Lights.Light.BrickColor=BrickColor.New("\073\110\115\116\105\116\117\116\105\111\110\097\108 \119\104\105\116\101")z.Body.Lights.RN.Light.Enabled=true function off()z.Body.Lights.Light.BrickColor=BrickColor.New("\068\097\114\107 \115\116\111\110\101 \103\114\101\121")z.Body.Lights.RN.Material=Enum.Material.SmoothPlastic z.Body.Lights.RN.BrickColor=BrickColor.New("\067\114\105\109\115\111\110")z.Body.Lights.Light.Light.Enabled=false z.Body.Lights.Light.Material=Enum.Material.SmoothPlastic z.Body.Lights.RN.Light.Enabled=false for z,p in pairs(z.Body.Lights:GetChildren())do if p.Name=="\076\105\103\104\116\050"then p.Material=Enum.Material.SmoothPlastic p.Light.Enabled=false end end end end function on2()for p,u in pairs(z.Body.Lights:GetChildren())do if u.Name=="\076\105\103\104\116\050"then u.Material=Enum.Material.Neon u.Light.Enabled=true for z,p in pairs(z.Body.Lights:GetChildren())do if p.Name=="\076\105\103\104\116"then p.BrickColor=BrickColor.new("\068\097\114\107 \115\116\111\110\101 \103\114\101\121")p.Material=Enum.Material.SmoothPlastic p.Light.Enabled=false end end end end end function auto()if game.Lighting:GetMinutesAfterMidnight()<390 or game.Lighting:GetMinutesAfterMidnight()>1050 then z.Body.Lights.Light.Material=Enum.Material.Neon z.Body.Lights.Light.Light.Enabled=true z.Body.Lights.RN.BrickColor=BrickColor.New("\066\114\105\103\104\116 \114\101\100")z.Body.Lights.RN.Light.Enabled=true else z.Body.Lights.RN.Light.Enabled=false z.Body.Lights.RN.Material=Enum.Material.SmoothPlastic z.Body.Lights.RN.BrickColor=BrickColor.New("\077\097\114\111\111\110")z.Body.Lights.Light.Light.Enabled=false z.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 \040\049\041"elseif script.parent.Text=="\076\105\103\104\116\115\058 \079\110 \040\049\041"then on2()script.Parent.Text="\076\105\103\104\116\115\058 \079\110 \040\050\041"elseif script.Parent.Text=="\076\105\103\104\116\115\058 \079\110 \040\050\041"then off()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 z,u in pairs(z.Body.Lights:GetChildren())do if u.Name=="\082"then if u.Light.Enabled then if p.Value>0 then u.Transparency=0 u.Light.Brightness=12 u.Light.Range=15 else u.Transparency=.3 u.Light.Brightness=8 u.Light.Range=10 end else u.Transparency=0 if p.Value>0 then u.Material=Enum.Material.Neon else u.Material=Enum.Material.SmoothPlastic end end elseif u.Name=="\082\082"then if p.Value>0 then u.Material=Enum.Material.Neon if u.Light.Enabled then u.Transparency=1 else u.Transparency=0 end else u.Transparency=1 if u.Light.Enabled then u.Material=Enum.Material.Neon else u.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.RN.BrickColor=BrickColor.New("Maroon")
		car.Body.Lights.RN.Material=Enum.Material.Neon
		car.Body.Lights.Light.Material=Enum.Material.Neon
		car.Body.Lights.Light.Light.Enabled = true
		car.Body.Lights.Light.BrickColor=BrickColor.New("Institutional white")
		car.Body.Lights.RN.Light.Enabled = true
function off()
	car.Body.Lights.Light.BrickColor=BrickColor.New("Dark stone grey")
		car.Body.Lights.RN.Material=Enum.Material.SmoothPlastic
		car.Body.Lights.RN.BrickColor=BrickColor.New("Crimson")
		car.Body.Lights.Light.Light.Enabled = false
		car.Body.Lights.Light.Material=Enum.Material.SmoothPlastic
		car.Body.Lights.RN.Light.Enabled = false
		for i,v in pairs(car.Body.Lights:GetChildren()) do
			if v.Name == "Light2" then
				v.Material=Enum.Material.SmoothPlastic
				v.Light.Enabled = false
			end
		end
end
end
function on2()
	for i,v in pairs(car.Body.Lights:GetChildren()) do
		if v.Name == "Light2" then
			v.Material=Enum.Material.Neon
			v.Light.Enabled = true
			for i,v in pairs(car.Body.Lights:GetChildren()) do
				if v.Name == "Light" then
					v.BrickColor=BrickColor.new("Dark stone grey")
					v.Material = Enum.Material.SmoothPlastic
					v.Light.Enabled = false
				end
			end
		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
		car.Body.Lights.RN.BrickColor=BrickColor.New("Bright red")
		car.Body.Lights.RN.Light.Enabled = true
	else
		car.Body.Lights.RN.Light.Enabled = false
		car.Body.Lights.RN.Material=Enum.Material.SmoothPlastic
		car.Body.Lights.RN.BrickColor=BrickColor.New("Maroon")
		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 (1)"
	elseif script.parent.Text == "Lights: On (1)" then
		on2()
		script.Parent.Text = "Lights: On (2)"
	elseif script.Parent.Text == "Lights: On (2)" then
		off()
		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 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()
