Any difference between GetOrderedDataStore and GetDataStore

Hello fellow scripters! So I was just wondering if there is any difference between GetOrderedDataStore and GetDataStore. For example, if you wanted to make a global leaderboard, could you use either? Thank you for reading!

For one thing, Ordered data stores have the GetSortedAsync() method while normal data stores don’t. Also, the only value you can store in Ordered data stores are integers, while you can store a lot of other types of values in normal data stores. I think that’s all though.

So the answer to your question is you can’t use either for a leaderboard, as you can only use GetSortedAsync() on an ordered data store.

2 Likes

The advantage of an ordered datastore is that you can query all key-value pairs in the database, which makes something like a global leaderboard possible. A normal datastore doesn’t have that ability, but it’s also not limited to storing numbers like an ordered datastore is, which makes it much more useful for actual storage. A common practice is to save the player’s data in a normal datastore, and to save whatever number you want to measure your leaderboard by in a separate ordered datastore.

14 Likes