Scrolling frame isnt displaying all frames

  1. What do you want to achieve? Keep it simple and clear!
    I want to display the top 25 players with the highest level in the scrolling frame

  2. What is the issue? Include screenshots / videos if possible!
    The issue is that only the top 6.5 players are shown.


    As you can see below the last player in the scrolling frame is Player19zzz but I have a warn that prints every player name possible.

I don’t have any experience with scrolling frames so I am not sure how to fix this issue, any help would be great!

local event = game:GetService("ReplicatedStorage"):WaitForChild("Leaderboard")
local sample = script:WaitForChild("Sample")  --frame that gets put into scrollingframe
local frame = script.Parent
local ui = frame:WaitForChild("UI")


local function createFrame(number,name,image,val)  --parent the frame to scrollingframe
	local color = Color3.new(1,1,1)
	if number == 1 then
		color = Color3.new(1,1,0)
	elseif number == 2 then
		color = Color3.new(0.9,0.9,0.9)
	elseif number == 3 then
		color = Color3.fromRGB(166,112,0)
	end
	local new = sample:Clone()
	new.Image.Image = image
	new.Image.Num.Text = number
	new.Nam.Text = name
	new.Wins.Text = val
	new.LayoutOrder = number
	new.Image.Num.TextColor3 = color
	new.Wins.TextColor3 = color
	new.Nam.TextColor3 = color
	new.Parent = frame
end
event.OnClientEvent:Connect(function(data) 	
	for i,v in pairs(frame:GetChildren()) do
		if v.Name == "Sample" then
			v:Destroy()
		end
	end
	for i, v in pairs(data)do
		local name = data[i]["Name"]
		local image = data[i]["Image"]
		local val = data[i]["Wins"]
		createFrame(i,name,image,val)
		warn(name)
	end
	wait(0.1)
	frame.CanvasSize = UDim2.new(0,0,1,0)
end)

adjust the “canvasSize” (in properties) of the scrolling frame (make it smaller)

If I do that then the frames inside are extremely stretched out


I’m guessing they need fixed values instead of percent values?

sorry i mean make the canvasSize smaller (if u notice the frames getting smaller too, adjust their size to offset)

1 Like

I was obviously doing something wrong with canvas size so I set it to automatic XY and it works now, thanks!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.