-- light functions


F.SignalLeft = function(flash_rate, state, active, tb, type, seq, max_segs, current_segment)
	if active then
		if not seq then
			if state then
				if type == "Halogen" then			
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
						
					local gtwe = TweenService:Create(tb[5], t, {ImageTransparency = 0})
					gtwe:Play()			
			
					for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if child:IsA("SpotLight") then
							local tw = TweenService:Create(child, t, {Brightness = 1, Range = 16})
							tw:Play()
						elseif child.Name == "LN" then
							local tw = TweenService:Create(child, t, {Transparency = 0.02})
							tw:Play()		
						end
					end
				elseif type == "LED" then
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
	
					local gtwe = TweenService:Create(tb[5], t, {ImageTransparency = 0})
					gtwe:Play()	
					
					for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if child:IsA("SpotLight") then
							child.Brightness = 1
							child.Range = 16
						elseif child.Name == "LN" then
							child.Transparency = 0.02
						end
					end				
				end	
				wait(flash_rate)
			else
				if type == "Halogen" then
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
				
					local gtwe = TweenService:Create(tb[5], t, {ImageTransparency = 1})
					gtwe:Play()				
			
					for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if child:IsA("SpotLight") then
							local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
							tw:Play()
						elseif child.Name == "LN" then
							local tw = TweenService:Create(child, t, {Transparency = 1})
							tw:Play()	
						end
					end
				elseif type == "LED" then
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
	
					local gtwe = TweenService:Create(tb[5], t, {ImageTransparency = 1})
					gtwe:Play()	
	
						for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if child:IsA("SpotLight") then
							child.Brightness = 0
							child.Range = 0
						elseif child.Name == "LN" then
							child.Transparency = 1
						end
					end				
				end				
				wait(flash_rate)
			end
		else
			if state then
				if type == "Halogen" then			
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

					local gtwe = TweenService:Create(tb[5], t, {ImageTransparency = 0})
					gtwe:Play()			

					for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if child.Name == "SI"..tostring(current_segment) then
							local tw = TweenService:Create(child, t, {Transparency = 0.02})
							tw:Play()		
						end
					end
				elseif type == "LED" then
					for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if child.Name == "SI"..tostring(current_segment) then
							child.Transparency = 0.02	
						end
					end			
				end	
			else
				if type == "Halogen" then			
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

					local gtwe = TweenService:Create(tb[5], t, {ImageTransparency = 1})
					gtwe:Play()			

					for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if string.sub(child.Name, 1, 2) == "SI" then
							local tw = TweenService:Create(child, t, {Transparency = 1})
							tw:Play()		
						end
					end
				elseif type == "LED" then
					for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if string.sub(child.Name, 1, 2) == "SI" then
							child.Transparency = 1	
						end
					end			
				end	
			end
		end
	else
		if not seq then
			if type == "Halogen" then
				local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
	
				local gtwe = TweenService:Create(tb[5], t, {ImageTransparency = 1})
				gtwe:Play()				
	
				for idx, child in pairs(lights.LeftInd:GetDescendants()) do
					if child:IsA("SpotLight") then
						local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
						tw:Play()
					elseif child.Name == "LN" then
						local tw = TweenService:Create(child, t, {Transparency = 1})
						tw:Play()		
					end
				end
			elseif type == "LED" then
				for idx, child in pairs(lights.LeftInd:GetDescendants()) do
					if child:IsA("SpotLight") then
						child.Brightness = 0
						child.Range = 0
					elseif child.Name == "LN" then
						child.Transparency = 1
					end
				end				
			end				
			wait(flash_rate)
		else
			if state then
				if type == "Halogen" then			
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

					local gtwe = TweenService:Create(tb[5], t, {ImageTransparency = 0})
					gtwe:Play()			

					for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if child.Name == "SI"..tostring(current_segment) then
							local tw = TweenService:Create(child, t, {Transparency = 0.02})
							tw:Play()		
						end
					end
				elseif type == "LED" then
					for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if child.Name == "SI"..tostring(current_segment) then
							child.Transparency = 0.02	
						end
					end			
				end	
			else
				if type == "Halogen" then			
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

					local gtwe = TweenService:Create(tb[5], t, {ImageTransparency = 1})
					gtwe:Play()			

					for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if string.sub(child.Name, 1, 2) == "SI" then
							local tw = TweenService:Create(child, t, {Transparency = 1})
							tw:Play()		
						end
					end
				elseif type == "LED" then
					for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if string.sub(child.Name, 1, 2) == "SI" then
							child.Transparency = 1	
						end
					end			
				end	
			end		
		end			
	end	
end

F.SignalRight = function(flash_rate, state, active, tb, type, seq, max_segs, current_segment)
	if active then
		if not seq then
			if state then
				if type == "Halogen" then			
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

					local gtwe = TweenService:Create(tb[6], t, {ImageTransparency = 0})
					gtwe:Play()			

					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if child:IsA("SpotLight") then
							local tw = TweenService:Create(child, t, {Brightness = 1, Range = 16})
							tw:Play()
						elseif child.Name == "LN" then
							local tw = TweenService:Create(child, t, {Transparency = 0.02})
							tw:Play()		
						end
					end
				elseif type == "LED" then
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

					local gtwe = TweenService:Create(tb[6], t, {ImageTransparency = 0})
					gtwe:Play()	

					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if child:IsA("SpotLight") then
							child.Brightness = 1
							child.Range = 16
						elseif child.Name == "LN" then
							child.Transparency = 0.02
						end
					end				
				end	
				wait(flash_rate)
			else
				if type == "Halogen" then
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

					local gtwe = TweenService:Create(tb[6], t, {ImageTransparency = 1})
					gtwe:Play()				

					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if child:IsA("SpotLight") then
							local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
							tw:Play()
						elseif child.Name == "LN" then
							local tw = TweenService:Create(child, t, {Transparency = 1})
							tw:Play()	
						end
					end
				elseif type == "LED" then
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

					local gtwe = TweenService:Create(tb[6], t, {ImageTransparency = 1})
					gtwe:Play()	

					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if child:IsA("SpotLight") then
							child.Brightness = 0
							child.Range = 0
						elseif child.Name == "LN" then
							child.Transparency = 1
						end
					end				
				end				
				wait(flash_rate)
			end
		else
			if state then
				if type == "Halogen" then			
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

					local gtwe = TweenService:Create(tb[6], t, {ImageTransparency = 0})
					gtwe:Play()			

					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if child.Name == "SI"..tostring(current_segment) then
							local tw = TweenService:Create(child, t, {Transparency = 0.02})
							tw:Play()		
						end
					end
				elseif type == "LED" then
					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if child.Name == "SI"..tostring(current_segment) then
							child.Transparency = 0.02	
						end
					end			
				end	
			else
				if type == "Halogen" then			
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

					local gtwe = TweenService:Create(tb[6], t, {ImageTransparency = 1})
					gtwe:Play()			

					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if string.sub(child.Name, 1, 2) == "SI" then
							local tw = TweenService:Create(child, t, {Transparency = 1})
							tw:Play()		
						end
					end
				elseif type == "LED" then
					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if string.sub(child.Name, 1, 2) == "SI" then
							child.Transparency = 1	
						end
					end			
				end	
			end
		end
	else
		if not seq then
			if type == "Halogen" then
				local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

				local gtwe = TweenService:Create(tb[6], t, {ImageTransparency = 1})
				gtwe:Play()				

				for idx, child in pairs(lights.RightInd:GetDescendants()) do
					if child:IsA("SpotLight") then
						local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
						tw:Play()
					elseif child.Name == "LN" then
						local tw = TweenService:Create(child, t, {Transparency = 1})
						tw:Play()		
					end
				end
			elseif type == "LED" then
				for idx, child in pairs(lights.RightInd:GetDescendants()) do
					if child:IsA("SpotLight") then
						child.Brightness = 0
						child.Range = 0
					elseif child.Name == "LN" then
						child.Transparency = 1
					end
				end				
			end				
			wait(flash_rate)
		else
			if state then
				if type == "Halogen" then			
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

					local gtwe = TweenService:Create(tb[6], t, {ImageTransparency = 0})
					gtwe:Play()			

					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if child.Name == "SI"..tostring(current_segment) then
							local tw = TweenService:Create(child, t, {Transparency = 0.02})
							tw:Play()		
						end
					end
				elseif type == "LED" then
					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if child.Name == "SI"..tostring(current_segment) then
							child.Transparency = 0.02	
						end
					end			
				end	
			else
				if type == "Halogen" then			
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

					local gtwe = TweenService:Create(tb[6], t, {ImageTransparency = 1})
					gtwe:Play()			

					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if string.sub(child.Name, 1, 2) == "SI" then
							local tw = TweenService:Create(child, t, {Transparency = 1})
							tw:Play()		
						end
					end
				elseif type == "LED" then
					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if string.sub(child.Name, 1, 2) == "SI" then
							child.Transparency = 1	
						end
					end			
				end	
			end		
		end			
	end	
end

F.Hazards = function(flash_rate, state, active, tb, type, seq, max_segs, current_segment)
	if active then
		if not seq then
			if state then
				if type == "Halogen" then			
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
				
					local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 0})			
					local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 0})
					gtwe1:Play()				
					gtwe2:Play()				
					
					for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if child:IsA("SpotLight") then
						local tw = TweenService:Create(child, t, {Brightness = 1, Range = 16})
							tw:Play()
						elseif child.Name == "LN" then
							local tw = TweenService:Create(child, t, {Transparency = 0.02})
							tw:Play()	
						end
					end
					
					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if child:IsA("SpotLight") then
							local tw = TweenService:Create(child, t, {Brightness = 1, Range = 16})
							tw:Play()
						elseif child.Name == "LN" then
							local tw = TweenService:Create(child, t, {Transparency = 0.02})
							tw:Play()		
						end
					end
				elseif type == "LED" then
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
	
					local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 0})			
					local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 0})
					gtwe1:Play()				
					gtwe2:Play()				
	
					for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if child:IsA("SpotLight") then
							child.Brightness = 2
							child.Range = 16
						elseif child.Name == "LN" then
							child.Transparency = 0
						end
					end
					
					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if child:IsA("SpotLight") then
							child.Brightness = 2
							child.Range = 16
						elseif child.Name == "LN" then
							child.Transparency = 0
						end
					end						
				end		
			
				wait(flash_rate)
			else
				if type == "Halogen" then			
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

					local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 1})			
					local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 1})
					gtwe1:Play()				
					gtwe2:Play()				

					for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if child:IsA("SpotLight") then
							local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
							tw:Play()
						elseif child.Name == "LN" then
							local tw = TweenService:Create(child, t, {Transparency = 1})
							tw:Play()	
						end
					end

					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if child:IsA("SpotLight") then
							local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
							tw:Play()
						elseif child.Name == "LN" then
							local tw = TweenService:Create(child, t, {Transparency = 1})
							tw:Play()
						end
					end
				elseif type == "LED" then
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
	
					local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 1})			
					local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 1})
					gtwe1:Play()				
					gtwe2:Play()				
	
					for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if child:IsA("SpotLight") then
							child.Brightness = 0
							child.Range = 0
						elseif child.Name == "LN" then
							child.Transparency = 1
						end
					end

					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if child:IsA("SpotLight") then
							child.Brightness = 0
							child.Range = 0
						elseif child.Name == "LN" then
							child.Transparency = 1
						end
					end						
				end				
				wait(flash_rate)		
			end
		else
			if state then
				if type == "Halogen" then			
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

					local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 0})			
					local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 0})
					gtwe1:Play()				
					gtwe2:Play()				

					for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if child.Name == "SI"..tostring(current_segment) then
							local tw = TweenService:Create(child, t, {Transparency = 0.02})
							tw:Play()		
						end
					end
					
					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if child.Name == "SI"..tostring(current_segment) then
							local tw = TweenService:Create(child, t, {Transparency = 0.02})
							tw:Play()		
						end
					end
				elseif type == "LED" then
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

					local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 0})			
					local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 0})
					gtwe1:Play()				
					gtwe2:Play()				

					for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if child.Name == "SI"..tostring(current_segment) then
							child.Transparency = 0.02		
						end
					end

					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if child.Name == "SI"..tostring(current_segment) then
							child.Transparency = 0.02	
						end
					end					
				end		

				wait(flash_rate)
			else
				if type == "Halogen" then			
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

					local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 1})			
					local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 1})
					gtwe1:Play()				
					gtwe2:Play()				

					for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if string.sub(child.Name, 1, 2) == "SI" then
							local tw = TweenService:Create(child, t, {Transparency = 1})
							tw:Play()		
						end
					end

					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if string.sub(child.Name, 1, 2) == "SI" then
							local tw = TweenService:Create(child, t, {Transparency = 1})
							tw:Play()		
						end
					end
				elseif type == "LED" then
					local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

					local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 1})			
					local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 1})
					gtwe1:Play()				
					gtwe2:Play()				

					for idx, child in pairs(lights.LeftInd:GetDescendants()) do
						if string.sub(child.Name, 1, 2) == "SI" then
							child.Transparency = 1		
						end
					end

					for idx, child in pairs(lights.RightInd:GetDescendants()) do
						if string.sub(child.Name, 1, 2) == "SI" then
							child.Transparency = 1
						end	
					end					
				end		
				wait(flash_rate)
			end			
		end	
	else
		if not seq then
			if type == "Halogen" then			
				local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

				local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 1})			
				local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 1})
				gtwe1:Play()				
				gtwe2:Play()				
	
				for idx, child in pairs(lights.LeftInd:GetDescendants()) do
					if child:IsA("SpotLight") then
						local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
						tw:Play()
					elseif child.Name == "LN" then
						local tw = TweenService:Create(child, t, {Transparency = 1})
						tw:Play()
					end
				end

				for idx, child in pairs(lights.RightInd:GetDescendants()) do
					if child:IsA("SpotLight") then
						local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
						tw:Play()
					elseif child.Name == "LN" then
						local tw = TweenService:Create(child, t, {Transparency = 1})
						tw:Play()	
					end
				end
			elseif type == "LED" then
				local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
	
				local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 1})			
				local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 1})
				gtwe1:Play()				
				gtwe2:Play()				

				for idx, child in pairs(lights.LeftInd:GetDescendants()) do
					if child:IsA("SpotLight") then
						child.Brightness = 0
						child.Range = 0
					elseif child.Name == "LN" then
						child.Transparency = 1
					end
				end
	
				for idx, child in pairs(lights.RightInd:GetDescendants()) do
					if child:IsA("SpotLight") then
						child.Brightness = 0
						child.Range = 0
					elseif child.Name == "LN" then
						child.Transparency = 1
					end
				end						
			end				
			wait(flash_rate)
		else
			if type == "Halogen" then			
				local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

				local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 1})			
				local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 1})
				gtwe1:Play()				
				gtwe2:Play()				

				for idx, child in pairs(lights.LeftInd:GetDescendants()) do
					if string.sub(child.Name, 1, 2) == "SI" then
						local tw = TweenService:Create(child, t, {Transparency = 1})
						tw:Play()		
					end
				end

				for idx, child in pairs(lights.RightInd:GetDescendants()) do
					if string.sub(child.Name, 1, 2) == "SI" then
						local tw = TweenService:Create(child, t, {Transparency = 1})
						tw:Play()		
					end
				end
			elseif type == "LED" then
				local t = TweenInfo.new(flash_rate / 2.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

				local gtwe1 = TweenService:Create(tb[5], t, {ImageTransparency = 1})			
				local gtwe2 = TweenService:Create(tb[6], t, {ImageTransparency = 1})
				gtwe1:Play()				
				gtwe2:Play()				

				for idx, child in pairs(lights.LeftInd:GetDescendants()) do
					if string.sub(child.Name, 1, 2) == "SI" then
						child.Transparency = 1		
					end
				end

				for idx, child in pairs(lights.RightInd:GetDescendants()) do
					if string.sub(child.Name, 1, 2) == "SI" then
						child.Transparency = 1
					end	
				end					
			end		
			wait(flash_rate)
		end			
	end		
end

F.Headlights = function(state, fade_time, tb, type)
	if type == "Halogen" then
		if state == 0 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
	
			local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			gtwe1:Play()
			gtwe2:Play()
			
			if plactive then
				for idx, child in pairs(lights.Headlights.Low:GetDescendants()) do
					if child:IsA("SpotLight") then
						local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
						tw:Play()
					elseif child.Name == "LN" then
						local tw = TweenService:Create(child, t, {Transparency = 0.7})
						tw:Play()	
					end
				end
				for idx, child in pairs(lights.Headlights.High:GetDescendants()) do
					if child:IsA("SpotLight") then
						local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
						tw:Play()
					elseif child.Name == "LN" then
						local tw = TweenService:Create(child, t, {Transparency = 1})
						tw:Play()	
					end
				end
			elseif not plactive then
				for idx, child in pairs(lights.Headlights:GetDescendants()) do
					if child:IsA("SpotLight") then
						local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
						tw:Play()
					elseif child.Name == "LN" then
						local tw = TweenService:Create(child, t, {Transparency = 1})
						tw:Play()	
					end
				end				
			end	
		elseif state == 1 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
			
			local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
			gtwe1:Play()
			gtwe2:Play()		
			
			for idx, child in pairs(lights.Headlights.Low:GetDescendants()) do
				if child:IsA("SpotLight") then
					local tw = TweenService:Create(child, t, {Brightness = 2, Range = 48})
					tw:Play()
				elseif child.Name == "LN" then
					local tw = TweenService:Create(child, t, {Transparency = 0.2})
					tw:Play()	
				end
			end			
		elseif state == 2 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
			
			local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
			local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			gtwe1:Play()
			gtwe2:Play()		
				
			for idx, child in pairs(lights.Headlights:GetDescendants()) do
				if child:IsA("SpotLight") then
					local tw = TweenService:Create(child, t, {Brightness = 3.5, Range = 60})
					tw:Play()
				elseif child.Name == "LN" then
					local tw = TweenService:Create(child, t, {Transparency = 0.02})
					tw:Play()	
				end
			end				
		elseif state == 3 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
	
			local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
			local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			gtwe1:Play()
			gtwe2:Play()		

			for idx, child in pairs(lights.Headlights:GetDescendants()) do
				if child:IsA("SpotLight") then
					local tw = TweenService:Create(child, t, {Brightness = 4.25, Range = 60})
					tw:Play()
				elseif child.Name == "LN" then
					local tw = TweenService:Create(child, t, {Transparency = 0.02})
					tw:Play()	
				end
			end				
		end
	elseif type == "LED" then
		if state == 0 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			gtwe1:Play()
			gtwe2:Play()

			if plactive then
				for idx, child in pairs(lights.Headlights.Low:GetDescendants()) do
					if child:IsA("SpotLight") then
						child.Brightness = 0
						child.Range = 0
					elseif child.Name == "LN" then
						child.Transparency = 0.7
					end
				end
				for idx, child in pairs(lights.Headlights.High:GetDescendants()) do
					if child:IsA("SpotLight") then
						child.Brightness = 0
						child.Range = 0
					elseif child.Name == "LN" then
						child.Transparency = 1
					end
				end
			elseif not plactive then
				for idx, child in pairs(lights.Headlights:GetDescendants()) do
					if child:IsA("SpotLight") then
						child.Brightness = 0
						child.Range = 0
					elseif child.Name == "LN" then
						child.Transparency = 1
					end
				end	
			end	
		elseif state == 1 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
			gtwe1:Play()
			gtwe2:Play()	
			
			for idx, child in pairs(lights.Headlights:GetDescendants()) do
				if child:IsA("SpotLight") then
					child.Brightness = 2
					child.Range = 48
				elseif child.Name == "LN" then
					child.Transparency = 0.2
				end
			end			
		elseif state == 2 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
			local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			gtwe1:Play()
			gtwe2:Play()		

			for idx, child in pairs(lights.Headlights:GetDescendants()) do
				if child:IsA("SpotLight") then
					child.Brightness = 3.5
					child.Range = 60
				elseif child.Name == "LN" then
					child.Transparency = 0.02
				end
			end				
		elseif state == 3 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
			local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			gtwe1:Play()
			gtwe2:Play()		

			for idx, child in pairs(lights.Headlights:GetDescendants()) do
				if child:IsA("SpotLight") then
					child.Brightness = 4.25
					child.Range = 60
				elseif child.Name == "LN" then
					child.Transparency = 0.02
				end
			end				
		end	
	end
end

F.Popups = function(state, enabled)
	if enabled then
		local motor = PHeadlights.Hinge:WaitForChild("Motor")
		motor.MaxVelocity = 0.08
		
		if state then
			motor.DesiredAngle = -0.9
		elseif not state then
			motor.DesiredAngle = 0
		end
	end
end

F.PopupLights = function(state, fade_time, tb, type)
	if type == "Halogen" then
		if state == 0 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			gtwe1:Play()
			gtwe2:Play()

			if plactive then
				for idx, child in pairs(PHeadlights.Parts.Headlights:GetDescendants()) do
					if child:IsA("SpotLight") then
						local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
						tw:Play()
					elseif child.Name == "LN" then
						local tw = TweenService:Create(child, t, {Transparency = 0.7})
						tw:Play()	
					end
				end
			elseif not plactive then
				for idx, child in pairs(PHeadlights.Parts.Headlights:GetDescendants()) do
					if child:IsA("SpotLight") then
						local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
						tw:Play()
					elseif child.Name == "LN" then
						local tw = TweenService:Create(child, t, {Transparency = 1})
						tw:Play()	
					end
				end				
			end	
		elseif state == 1 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
			gtwe1:Play()
			gtwe2:Play()		

			for idx, child in pairs(PHeadlights.Parts.Headlights:GetDescendants()) do
				if child:IsA("SpotLight") then
					local tw = TweenService:Create(child, t, {Brightness = 2, Range = 48})
					tw:Play()
				elseif child.Name == "LN" then
					local tw = TweenService:Create(child, t, {Transparency = 0.2})
					tw:Play()	
				end
			end			
		elseif state == 2 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
			local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			gtwe1:Play()
			gtwe2:Play()		

			for idx, child in pairs(PHeadlights.Parts.Headlights:GetDescendants()) do
				if child:IsA("SpotLight") then
					local tw = TweenService:Create(child, t, {Brightness = 3.5, Range = 60})
					tw:Play()
				elseif child.Name == "LN" then
					local tw = TweenService:Create(child, t, {Transparency = 0.02})
					tw:Play()	
				end
			end				
		elseif state == 3 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
			local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			gtwe1:Play()
			gtwe2:Play()		

			for idx, child in pairs(PHeadlights.Parts.Headlights:GetDescendants()) do
				if child:IsA("SpotLight") then
					local tw = TweenService:Create(child, t, {Brightness = 4.25, Range = 60})
					tw:Play()
				elseif child.Name == "LN" then
					local tw = TweenService:Create(child, t, {Transparency = 0.02})
					tw:Play()	
				end
			end				
		end
	elseif type == "LED" then
		if state == 0 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			gtwe1:Play()
			gtwe2:Play()

			if plactive then
				for idx, child in pairs(lights.Headlights:GetDescendants()) do
					if child:IsA("SpotLight") then
						child.Brightness = 0
						child.Range = 0
					elseif child.Name == "LN" then
						child.Transparency = 0.7
					end
				end
			elseif not plactive then
				for idx, child in pairs(lights.Headlights:GetDescendants()) do
					if child:IsA("SpotLight") then
						child.Brightness = 0
						child.Range = 0
					elseif child.Name == "LN" then
						child.Transparency = 1
					end
				end	
			end	
		elseif state == 1 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
			gtwe1:Play()
			gtwe2:Play()	

			for idx, child in pairs(lights.Headlights:GetDescendants()) do
				if child:IsA("SpotLight") then
					child.Brightness = 2
					child.Range = 48
				elseif child.Name == "LN" then
					child.Transparency = 0.2
				end
			end			
		elseif state == 2 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
			local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			gtwe1:Play()
			gtwe2:Play()		

			for idx, child in pairs(lights.Headlights:GetDescendants()) do
				if child:IsA("SpotLight") then
					child.Brightness = 3.5
					child.Range = 60
				elseif child.Name == "LN" then
					child.Transparency = 0.02
				end
			end				
		elseif state == 3 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			local gtwe1 = TweenService:Create(tb[1], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
			local gtwe2 = TweenService:Create(tb[2], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			gtwe1:Play()
			gtwe2:Play()		

			for idx, child in pairs(lights.Headlights:GetDescendants()) do
				if child:IsA("SpotLight") then
					child.Brightness = 4.25
					child.Range = 60
				elseif child.Name == "LN" then
					child.Transparency = 0.02
				end
			end				
		end			
	end	
end

F.FogLights = function(state, fade_time, tb, type)
	if state then
		if type == "Halogen" then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			local gtwe1 = TweenService:Create(tb[4], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
			gtwe1:Play()
			
			for idx, child in pairs(lights.Fog:GetDescendants()) do
				if child:IsA("SpotLight") then
					local tw = TweenService:Create(child, t, {Brightness = 3.75, Range = 60})
					tw:Play()
				elseif child.Name == "LN" then
					local tw = TweenService:Create(child, t, {Transparency = 0.02})
					tw:Play()	
				end
			end				
		elseif type == "LED" then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			local gtwe1 = TweenService:Create(tb[4], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
			gtwe1:Play()

			for idx, child in pairs(lights.Fog:GetDescendants()) do
				if child:IsA("SpotLight") then
					child.Brightness = 3.75
					child.Range = 60
				elseif child.Name == "LN" then
					child.Transparency = 0.02
				end
			end				
		end
	elseif not state then
		if type == "Halogen" then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			local gtwe1 = TweenService:Create(tb[4], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			gtwe1:Play()

			for idx, child in pairs(lights.Fog:GetDescendants()) do
				if child:IsA("SpotLight") then
					local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
					tw:Play()
				elseif child.Name == "LN" then
					local tw = TweenService:Create(child, t, {Transparency = 1})
					tw:Play()	
				end
			end				
		elseif type == "LED" then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			local gtwe1 = TweenService:Create(tb[4], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
			gtwe1:Play()

			for idx, child in pairs(lights.Fog:GetDescendants()) do
				if child:IsA("SpotLight") then
					child.Brightness = 0
					child.Range = 0
				elseif child.Name == "LN" then
					child.Transparency = 1
				end
			end				
		end		
	end
end

F.ParkLights = function(state, tb)
	if state then
		local gtwe = TweenService:Create(tb[3], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 0})
		gtwe:Play()
			
		plactive = true
	else
		local gtwe = TweenService:Create(tb[3], TweenInfo.new(0.05, Enum.EasingStyle.Quint), {ImageTransparency = 1})
		gtwe:Play()			
		
		plactive = false
	end
end

F.BrakeLights = function(state, fade_time, type)
	if type == "Halogen" then
		if state then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
		
			for idx, child in pairs(lights.Brake:GetDescendants()) do
				if child:IsA("SpotLight") then
					local tw = TweenService:Create(child, t, {Brightness = 2.5, Range = 38})
					tw:Play()			
				elseif child.Name == "LN" then
					local tw = TweenService:Create(child, t, {Transparency = 0.02})
					tw:Play()	
				end
			end			
		else
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
		
			for idx, child in pairs(lights.Brake:GetDescendants()) do
				if child:IsA("SpotLight") then
					local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
					tw:Play()			
				elseif child.Name == "LN" then
					local tw = TweenService:Create(child, t, {Transparency = 1})
					tw:Play()	
				end
			end				
		end
	elseif type == "LED" then
		if state then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			for idx, child in pairs(lights.Brake:GetDescendants()) do
				if child:IsA("SpotLight") then
					child.Brightness = 3.5
					child.Range = 38
				elseif child.Name == "LN" then
					child.Transparency = 0.02
				end
			end			
		else
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			for idx, child in pairs(lights.Brake:GetDescendants()) do
				if child:IsA("SpotLight") then
					child.Brightness = 0
					child.Range = 0
				elseif child.Name == "LN" then
					child.Transparency = 1
				end
			end				
		end		
	end	
end

F.RearLights = function(state, fade_time, type)
	if type == "Halogen" then
		if state == 0 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
	
			if plactive then
				for idx, child in pairs(lights.Rear:GetDescendants()) do
					if child:IsA("SpotLight") then
						local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
						tw:Play()
					elseif child.Name == "LN" then
						local tw = TweenService:Create(child, t, {Transparency = 0.7})
						tw:Play()	
					end
				end
			elseif not plactive then
				for idx, child in pairs(lights.Rear:GetDescendants()) do
					if child:IsA("SpotLight") then
						local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
						tw:Play()
					elseif child.Name == "LN" then
						local tw = TweenService:Create(child, t, {Transparency = 1})
						tw:Play()	
					end
				end				
			end				
		elseif state == 1 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
		
			for idx, child in pairs(lights.Rear:GetDescendants()) do
				if child:IsA("SpotLight") then
					local tw = TweenService:Create(child, t, {Brightness = 1.5, Range = 25})
					tw:Play()			
				elseif child.Name == "LN" then
					local tw = TweenService:Create(child, t, {Transparency = 0.2})
					tw:Play()	
				end
			end			
		end
	elseif type == "LED" then
		if state == 0 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			if plactive then
				for idx, child in pairs(lights.Rear:GetDescendants()) do
					if child:IsA("SpotLight") then
						child.Brightness = 0
						child.Range = 0
					elseif child.Name == "LN" then
						child.Transparency  = 0.7	
					end
				end
			elseif not plactive then
				for idx, child in pairs(lights.Rear:GetDescendants()) do
					if child:IsA("SpotLight") then
						child.Brightness = 0
						child.Range = 0
					elseif child.Name == "LN" then
						child.Transparency  = 1
					end
				end				
			end				
		elseif state == 1 then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			for idx, child in pairs(lights.Rear:GetDescendants()) do
				if child:IsA("SpotLight") then
					child.Brightness = 1.5
					child.Range = 25
				elseif child.Name == "LN" then
					child.Transparency  = 0.2
				end
			end			
		end	
	end
end	

F.DashboardIndicators = function(headlights, indicators, parklights)
	
end

F.Reverse = function(state, fade_time, type)
	if type == "Halogen" then
		if state then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
		
			for idx, child in pairs(lights.Reverse:GetDescendants()) do
				if child:IsA("SpotLight") then
					local tw = TweenService:Create(child, t, {Brightness = 1, Range = 20})
					tw:Play()			
				elseif child.Name == "LN" then
					local tw = TweenService:Create(child, t, {Transparency = 0.03})
					tw:Play()	
				end
			end	
		else
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)
			
			for idx, child in pairs(lights.Reverse:GetDescendants()) do
				if child:IsA("SpotLight") then
					local tw = TweenService:Create(child, t, {Brightness = 0, Range = 0})
					tw:Play()			
				elseif child.Name == "LN" then
					local tw = TweenService:Create(child, t, {Transparency = 1})
					tw:Play()	
				end
			end				
		end
	elseif type == "LED" then
		if state then
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			for idx, child in pairs(lights.Reverse:GetDescendants()) do
				if child:IsA("SpotLight") then
					child.Brightness = 1
					child.Range = 20
				elseif child.Name == "LN" then
					child.Transparency = 0.03
				end
			end	
		else
			local t = TweenInfo.new(fade_time, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0)

			for idx, child in pairs(lights.Reverse:GetDescendants()) do
				if child:IsA("SpotLight") then
					child.Brightness = 0
					child.Range = 0
				elseif child.Name == "LN" then
					child.Transparency = 1	
				end
			end				
		end		
	end	
end

F.IndsOnLeave = function(left, right, hazard, sequential, segs, fr, type)
	event.IndicatorsAfterLeave.Disabled = false
	wait()
	leaveseatevent:Fire(left, right, hazard, sequential, segs, fr, type)
end

event.OnServerEvent:Connect(function(pl, Fnc, ...)
	F[Fnc](...)
end)
