So i use ProfileService and i want to create a global leaderboard using GetOrderedDataStore & scopes i tried this, but the table is blank for some reason even tho i got data in it:
local ProfileStore = ProfileService.GetProfileStore(“PlayerDataTestNew2”,DataTemplate)
local ElimLeaderBoardStore = DataStoreService:GetOrderedDataStore(“PlayerDataTestNew2”,“ES”)
local pages:Pages = ElimLeaderBoardStore:GetSortedAsync(false,10)
for i,plr in pages:GetCurrentPage() do
print(i,plr.key)
print(plr.value)
end
Data stores and ordered data stores are different data stores. So, when you create one of each with the same name, data doesn’t replicate. You need to manually write in values to the ordered data stores and use :GetSortedAsync from there (saved values need to be integers). Don’t forget good data store code practice, like retry logic and error handling, as well as budgeting.