--------------------------------------------------------------#

function Tween(instance,tweeninformation,goals)
	TweenService:Create(instance,tweeninformation,goals):Play()
end
LightGroup = script.Parent.Lights:GetChildren()
while true do
	wait(0)
	if script.Parent.on.Value then
		soundfolder.BlinkOn:Play()
		for i = 1,#LightGroup do
			Tween(script.Parent.DLR,TweenInfo.new(deltatime),{Transparency = 1}) -- Add DLR under the "Left" model to make this work
			Tween(LightGroup[i],TweenInfo.new(deltatime),{Transparency = 0})
			Tween(LightGroup[i].Light,TweenInfo.new(deltatime),{Brightness = 2})
		end
		wait(0.4)
		soundfolder.BlinkOff:Play()
		for i = 1,#LightGroup do
			Tween(LightGroup[i],TweenInfo.new(deltatime),{Transparency = 1})
			Tween(LightGroup[i].Light,TweenInfo.new(deltatime),{Brightness = 0})
		end
		wait(0.5)
	else
		for i = 1,#LightGroup do
			Tween(script.Parent.DLR,TweenInfo.new(deltatime*2),{Transparency = 0})
			Tween(LightGroup[i],TweenInfo.new(deltatime),{Transparency = 1})
			Tween(LightGroup[i].Light,TweenInfo.new(deltatime),{Brightness = 0})
		end
		wait(0.1)
	end
end
