function PetSrollingFrame.SetTradingPlayerListCanvasSize(x,R)TradingPlayerListUI.Size=UDim2.new(.35,0,.6,0)local K,I,t=getSizes()local U=ScrollingFrame.AbsoluteSize local d=K*U d=UDim2.new(0,d.X,0,d.Y)local A=I*U A=UDim2.new(0,A.X,0,A.Y)UIGridLayout.CellPadding=d UIGridLayout.CellSize=A local h=ScrollingFrame:GetChildren()local F=0 if R==true then for R,x in pairs(ScrollingFrame:GetChildren())do if x:IsA("\073\109\097\103\101\076\097\098\101\108")and x:FindFirstChild("\068\097\116\097")then if x.Visible==true then F=F+1 end end end else F=#h-1 end local u=ScrollingFrame.AbsoluteSize.Y local y=UIGridLayout.CellSize.Y.Offset local w=UIGridLayout.CellPadding.Y.Offset UIGridLayout.FillDirectionMaxCells=t local D=math.ceil(F/UIGridLayout.FillDirectionMaxCells)local b=D*y+(D-1)*w ScrollingFrame.CanvasSize=UDim2.new(0,0,0,b+5)if TradingPlayerListUI.Visible==false then TradingPlayerListUI.Size=UDim2.new(0,0,0,0)end end
-- Set Pet Canvas Size --
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
