I made a custom leaderboard, but for some reason when I try to use a scrolling frame for the playerlist, instead of a frame, it messes up.
When I use a scrollbar:
When I use a frame:
local players = game:GetService("Players")
local playerFrame = game.ReplicatedStorage.PlayerFrame
local List = script.Parent.ScrollingFrame
local position = UDim2.new({0.818, 0},{0.069, 0})
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
function add()
for i, v in pairs(List:GetChildren()) do
v:Destroy()
end
for i, v in pairs(players:GetChildren()) do
local newFrame = playerFrame:Clone()
newFrame.Parent = List
local Name = newFrame:FindFirstChild("PlayerName")
Name.Text = v.Name
newFrame.Position = position
position = position + UDim2.new(0, 0, 0.145, 0)
end
position = UDim2.new({0.818, 0},{0.069, 0})
end
players.ChildAdded:Connect(function()
add()
end)
wait(0.5)
add()
players.ChildRemoved:Connect(function()
add()
end)```
![image|188x80](upload://1KQbFreO86LjYFrqVWt7rB8fyV9.png)