-- VisualComponents by Travis, modified for native visuals. 


local RS = game:GetService("RunService")
local panels = {}
wait(5)

function SetUp()

	for _,v in pairs(game.Workspace.VisualComponents.Panels:GetChildren()) do
		local temp = {}
		for image = 1,8 do		
			table.insert(temp,v.VisualScreen.Main["Image"..image])
		end
		table.insert(panels,temp)
	end
end
SetUp()

local len = #panels 
local max = 3000
local max8 = max/8;
for i,v in pairs(workspace.VisualComponents.Panels:GetChildren()) do
	RS.RenderStepped:connect(function()
		v.VisualScreen.Main.Image1.Visible = workspace.VisualComponents.Values.On.Value
		v.VisualScreen.Main.Image2.Visible = workspace.VisualComponents.Values.On.Value
		v.VisualScreen.Main.Image3.Visible = workspace.VisualComponents.Values.On.Value
		v.VisualScreen.Main.Image4.Visible = workspace.VisualComponents.Values.On.Value
		v.VisualScreen.Main.Image5.Visible = workspace.VisualComponents.Values.On.Value
		v.VisualScreen.Main.Image6.Visible = workspace.VisualComponents.Values.On.Value
		v.VisualScreen.Main.Image7.Visible = workspace.VisualComponents.Values.On.Value
		v.VisualScreen.Main.Image8.Visible = workspace.VisualComponents.Values.On.Value
	end)
end
RS.RenderStepped:connect(function(delta)
	local t = script.Value.Value
	local tempArr = {}	
	for image = 1,8 do 
		tempArr[image] = (t + image) * max8 % max
	end	
	for index = 1,len do 
		local temp2 = panels[index]
		for key, value in pairs(tempArr) do				
			temp2[key].Size = UDim2.new(0,value*10000,0,value*10000)
		end
	end
end)
