module.SetCanvasSize=function(U)local N,u,M=getSizes()local G=U.UIGridLayout local t=U.AbsoluteSize local L=N*t L=UDim2.new(0,L.X,0,L.Y)local z=u*t z=UDim2.new(0,z.X,0,z.Y)G.CellPadding=L G.CellSize=z local y=getItems(U)local E=U.AbsoluteSize.Y local b=G.CellSize.Y.Offset local m=G.CellPadding.Y.Offset G.FillDirectionMaxCells=M local f=math.ceil((y-1)/G.FillDirectionMaxCells)local J=f*b+(f-1)*m U.CanvasSize=UDim2.new(0,0,0,J+5)end local U=script.Parent.Parent.Parent.Parent.Parent:WaitForChild("\109\097\105\110")local N=U.WeaponShop function module.Int(U)((game:GetService("\087\111\114\107\115\112\097\099\101")).CurrentCamera:GetPropertyChangedSignal("\086\105\101\119\112\111\114\116\083\105\122\101")):Connect(function()delay(.5,function()module.SetCanvasSize(N.Storage.Swords)module.SetCanvasSize(N.Storage.Robot)module.SetCanvasSize(N.Storage.Storage)end)end)end return module

module.SetCanvasSize = function(ScrollingFrame)
	local PADDING,SIZE,MaxCells = getSizes()
	local UIGridLayout = ScrollingFrame.UIGridLayout
	local AbsoluteSize = ScrollingFrame.AbsoluteSize

    local NewPadding = PADDING * AbsoluteSize
    NewPadding = UDim2.new(0, NewPadding .X, 0, NewPadding .Y)
    local NewSize = SIZE * AbsoluteSize
    NewSize = UDim2.new(0, NewSize.X, 0, NewSize.Y)

    UIGridLayout.CellPadding = NewPadding
    UIGridLayout.CellSize = NewSize

	local items = getItems(ScrollingFrame) --ScrollingFrame:GetChildren()
	local frameSizeY = ScrollingFrame.AbsoluteSize.Y
	local ySize = UIGridLayout.CellSize.Y.Offset
	local yPadding = UIGridLayout.CellPadding.Y.Offset
	UIGridLayout.FillDirectionMaxCells = MaxCells
	local rows = math.ceil((items-1)/UIGridLayout.FillDirectionMaxCells)
	local pixels = rows*ySize + (rows-1)*yPadding
	ScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, (pixels + 5))
end

local main = script.Parent.Parent.Parent.Parent.Parent:WaitForChild("main")
local weaponShopUI = main.WeaponShop

function module:Int()
	game:GetService("Workspace").CurrentCamera:GetPropertyChangedSignal("ViewportSize"):Connect(function()
		delay(.5, function() 
			module.SetCanvasSize(weaponShopUI.Storage.Swords)
			module.SetCanvasSize(weaponShopUI.Storage.Robot)
			module.SetCanvasSize(weaponShopUI.Storage.Storage)
		end)
	end)
end

return module
