Need help with global leaderboard

Hello, i’ve ran into an issue with my global leaderboard.

--// Services
local DS = game:GetService("DataStoreService")
local RaisedData = DS:GetDataStore("Raised1")
local DonatedData = DS:GetDataStore("Donated1")

--// Dependencies
local RaisedLeader = workspace:WaitForChild("Raised");
local DonatedLeader = workspace:WaitForChild("Donated");
local SurfaceGuiRaised = RaisedLeader:WaitForChild("SurfaceGui");
local SurfaceGuiDonated = DonatedLeader:WaitForChild("SurfaceGui");
local ListRaised = SurfaceGuiRaised:WaitForChild("List");
local ListDonated = SurfaceGuiDonated:WaitForChild("List");
local ItemsRaised = ListRaised:WaitForChild("Items");
local ItemsDonated = ListDonated:WaitForChild("Items");

	local UserKeyRaised = Player.UserId
	local Success, Error = pcall(function()
		RaisedData:SetAsync(UserKeyRaised.."Raised", Player.leaderstats.Raised.Value);
		DonatedData:SetAsync(UserKeyRaised.."Donated", Player.leaderstats.Donated.Value);

while true do
	local DonatedOrderedDatastore = DS:GetOrderedDataStore("Donated1")
	local DonatedSorted = DonatedOrderedDatastore:GetSortedAsync(false,100,1,10e15)
	local DonatedPage = DonatedSorted:GetCurrentPage()
	local RaisedOrderedDatastore = DS:GetOrderedDataStore("Raised1")
	local RaisedSorted = RaisedOrderedDatastore:GetSortedAsync(false,100,1,10e15)
	local RaisedPage = RaisedSorted:GetCurrentPage()

I’m trying to get the page of the datastore, but it just prints {} and 40 Instance.
No errors, just confusion.

Is it returning an empty table?

You’re not trying to read from it, so I’m not sure if it’s working as expected or not.

for key, value in pairs(RaisedPage) do
    print(key, value)

See if that prints anything.

It didn’t print anything, you can print a normal table normally and it’ll print it’s contents.

Just realised i didn’t make the datastores on the top ordered :man_facepalming:
My mistake, thanks for your time.