I’m making a donation leaderboard for my game, i alredy got my way to save the Robux from the donations at the DataStore, and after saving it, i wanted to put it on a leaderboard, that is almost completed, but im having some issues by getting the value on the “GetOrderedDataStore”, i tryed using the code that is a the Help page, just for test, and it still don’t get the stored value from real players.
local DataStore = game:GetService("DataStoreService")
local pointsStore = DataStore:GetOrderedDataStore("Donates")
local function printTopSixPlayers()
local isAscending = false
local pageSize = 6
local pages = pointsStore:GetSortedAsync(isAscending, pageSize)
local topTen = pages:GetCurrentPage()
for rank, data in ipairs(topTen) do
local name = data.key
local points = data.value
print(name .. " is ranked #" .. rank .. " with " .. points .. "points")
end
end
pointsStore:SetAsync("Alex", 215)
pointsStore:SetAsync("Charley", 30)
pointsStore:SetAsync("Sydney", 20)
printTopSixPlayers()