function Tween(n,D,i)(TweenService:Create(n,D,i)):Play()end LightGroup=script.Parent.Lights:GetChildren()while true do wait(0)if script.Parent.on.Value then for n=1,#LightGroup,1 do Tween(LightGroup[n],TweenInfo.new(deltatime),{Transparency=0})Tween(LightGroup[n].Light,TweenInfo.new(deltatime),{Brightness=2})end else for n=1,#LightGroup,1 do Tween(LightGroup[n],TweenInfo.new(deltatime),{Transparency=1})Tween(LightGroup[n].Light,TweenInfo.new(deltatime),{Brightness=0})end end end
--------------------------------------------------------------#
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
		for i = 1, #LightGroup do
			Tween(LightGroup[i], TweenInfo.new(deltatime), { Transparency = 0 })
			Tween(LightGroup[i].Light, TweenInfo.new(deltatime), { Brightness = 2 })
		end
	else
		for i = 1, #LightGroup do
			Tween(LightGroup[i], TweenInfo.new(deltatime), { Transparency = 1 })
			Tween(LightGroup[i].Light, TweenInfo.new(deltatime), { Brightness = 0 })
		end
	end
end
