function PetSrollingFrame.SetTradingPlayerListCanvasSize(H,j)TradingPlayerListUI.Size=UDim2.new(.35,0,.6,0)local p,e,A=getSizes()local M=ScrollingFrame.AbsoluteSize local G=p*M G=UDim2.new(0,G.X,0,G.Y)local n=e*M n=UDim2.new(0,n.X,0,n.Y)UIGridLayout.CellPadding=G UIGridLayout.CellSize=n local q=ScrollingFrame:GetChildren()local W=0 if j==true then for j,H in pairs(ScrollingFrame:GetChildren())do if H:IsA("\073\109\097\103\101\076\097\098\101\108")and H:FindFirstChild("\068\097\116\097")then if H.Visible==true then W=W+1 end end end else W=#q-1 end local o=ScrollingFrame.AbsoluteSize.Y local h=UIGridLayout.CellSize.Y.Offset local f=UIGridLayout.CellPadding.Y.Offset UIGridLayout.FillDirectionMaxCells=A local U=math.ceil(W/UIGridLayout.FillDirectionMaxCells)local z=U*h+(U-1)*f ScrollingFrame.CanvasSize=UDim2.new(0,0,0,z+5)if TradingPlayerListUI.Visible==false then TradingPlayerListUI.Size=UDim2.new(0,0,0,0)end end

function PetSrollingFrame:SetTradingPlayerListCanvasSize(searchOn)
	TradingPlayerListUI.Size = UDim2.new(0.35, 0, 0.6, 0)
	
	local PADDING, SIZE, MaxCells = getSizes()
	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 children = ScrollingFrame:GetChildren()
	local items = 0
	if searchOn == true then
		for _, v in pairs(ScrollingFrame:GetChildren()) do
			if v:IsA("ImageLabel") and v:FindFirstChild("Data") then
				if v.Visible == true then
					items = items + 1
				end
			end
		end
	else
		items = (#children) - 1
	end
	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 / UIGridLayout.FillDirectionMaxCells)
	local pixels = rows * ySize + (rows - 1) * yPadding
	ScrollingFrame.CanvasSize = UDim2.new(0, 0, 0, (pixels + 5))
	
	if TradingPlayerListUI.Visible == false then
		TradingPlayerListUI.Size = UDim2.new(0, 0, 0, 0)
	end
end
