My recommended method for this is GetOrderedDataStore. The arguments you would pass are the key and the scope of the data.
EDIT: Forgot to note that the scope fo the data doesn't have to be specified, and it defaults to global anyways
Using your example it would be
local DataStore = game:GetService("DataStoreService"):GetOrderedDataStore("player-" .. plr.UserId)
From here, you would want to use GetSortedAsync on the datastore to get sorted pages for that selected value.
This step would look something like this (please note there are optional arguments and two required arguments. I picked the two that you would probably use, but please read up on the wiki to customize the code I've given)
local OrderedData = DataSTore:GetOrderedData(false, 10)
If you do not know how to use the information that is returned in OrderedData, I recommend reading up on Pages, and more specifically DataStorePages
1 comment
You would go about doing that with a script.