Global leaderboard not working

Hello! I am attempting to make a leaderboard in my game that will show the top donators in my game. When I attempt to test it, I get no errors, but also nothing happens with the leaderboard. So the script is basically doing nothing??? Any ideas are appreciated. Here is my code:

local ds = game:GetService("DataStoreService"):GetOrderedDataStore("Donations")

while true do
	for _, m in pairs(script.Parent:GetChildren()) do
		if m:IsA("ImageLabel") then m:Destroy() end
	end
	
	local s, r = pcall(function()
		
		local data = ds:GetSortedAsync(false, 5)
		local donationsPage = data:GetCurrentPage()
		
		for rank, value in ipairs(donationsPage) do
			if rank <= 50 then
				
				local name = game:GetService("Players"):GetNameFromUserIdAsync(tonumber(value.key))
				local donationAmount = value.value

				local template = script:WaitForChild("Template"):Clone()
				template.Name = rank .. "_" .. donationAmount
				template:WaitForChild("Rank").Text = rank
				template:WaitForChild("Username").Text = name
				template:WaitForChild("Donated").Text = donationAmount
				template.Parent = script.Parent
				template.Visible = true
				
			end
		end
		
	end)
	
	if not s then warn(r) end
	
	wait(300)
end

Does warn(r) send a warning to the output window? Is it possible that the OrderedDataStore is empty?

Yes, and no. This game has TONS of people who are within this data store.

What warning is displayed? It’s pertinent to the issue you’re facing.

No warning at all. That is part of my problem.

What does this do?
Isn’t it already getting the top players?

Yes, I just want the top 50 players however, nothing more.

I’m not super familiar with how ordered data stores work so I added that because I don’t understand the pages.

You can go here:

I believe all you need is this,
GetSortedAsync(false,50)
50 is the pagecount, which I think means the amount of players you want to pull

Mine is built into a screen GUI, not a surface GUI, therefore I have to program it myself, or modify scripts like that.

From what I have seen each page is around 100 players, but I could be wrong. Regardless that if statement wouldn’t be breaking the code.

UPDATE: I have put a print inside the code and realised that the ipairs loop is not running at all. This is likely my problem, however this data should not be empty.

I am not super intelligent. I am so sorry for being so idiotic, but it turns out Ordered data stores and Data stores are completely seperate, so I have converted my game to ordered data stores and now it works fine. Thank you to everyone to helped me out.