so i’m working on a global leaderboard system (for wins) but for some reason when i try retrieving the top 10 players it instead retrieves me an empty table (even though there’s hundreds of data entries already saved in my game (for wins) so i don’t know why it keeps returning empty tables)
i’ve also looked into some other posts which were exactly about this problem i have but it still didn’t work
here’s the code:
local DSS = game:GetService("DataStoreService")
local ODSWins = DSS:GetOrderedDataStore("WinsStore")
while task.wait(5) do
local page = ODSWins:GetSortedAsync(false, 10):GetCurrentPage()
print(page) -- (i also tried looping through the entire table but it didn't print anything at all)
end
there are no errors in the console (as it only prints out an empty table)
any help is appreciated
task.spawn(function()
while task.wait(5) do
local ODSWins = DSS:GetOrderedDataStore("WinsStore")
winsStore:SetAsync(plrId, wins.Value)
local page = ODSWins:GetSortedAsync(false, 10):GetCurrentPage()
print(page) -- (i also tried looping through the entire table but it didn't print anything at all)
end
end)
(i’ve also tried changing up the order of where setasync() is placed but it still returned me the same result)