Custom leaderboard not working

I’m making a custom leaderboard for my game. Everything looks right, but the script doesn’t work. the example is the only thing on the leaderboard and it doesn’t even move when I change teams.

I want to fix it.

I made it from this video [Intermediate/Advanced] Roblox Studio - Custom Player list Tutorial (w/ Teams) - YouTube
here’s the code

local Teams = game:GetService("Teams")
local template = script.Example
local Players = game:GetService("Players")
local Player = game.Players.LocalPlayer
local playerlist = script.Parent.ScrollingFrame


function clearList()
	for _, item in pairs(playerlist:GetChildren()) do
		if item:Isa("TextLabel") then
			item:Destroy()
		end
	end
end

for _, team in ipairs(Teams:GetTeams()) do
	local frame = template:Clone()
	frame.Name = team.Name
	frame.LayoutOrder = #playerlist:GetChildren()

end

function FillList()
	for _,Player in pairs(Players:GetChildren()) do
		if not playerlist:FindFirstChild(Player.Name) then
			local frame = Player.Name
			frame.Player.Text = Player.Name
			frame.Parent = playerlist



			frame.LayoutOrder = playerlist[Player.Team.Name].LayoutOrder + 1
			for _, object in pairs(playerlist:GetChildren()) do
				if object:IsA("Frame") and object.LayoutOrder >= frame.LayoutOrder and object ~= frame then
					object.LayoutOrder = object.LayoutOrder + 1
				end

			end
			Player:GetPropertyChangedSignal("TeamColor"):Connect(function()
				frame.LayoutOrder = playerlist[Player.Team.Name].LayoutOrder + 1
			end)
		end
	end
end
FillList()
clearList()
game.Players.PlayerAdded:Connect(FillList)
game.Players.PlayerRemoving:Connect(function(Player)
	if playerlist:FindFirstChild(Player.Name) then
		playerlist:FindFirstChild(Player.Name):Destroy()
	end
end)

and here’s a picture of the folds image
image

I have seen the video and it does not work well for it, I recommend you better this is simpler and more personalized:

But if you want to continue keeping that one, try to do everything the same as in the video (copy and paste) and if it works for you, then you are editing it little by little.

Because I do not see any type of failure, because UIcorner should not be incompatible