Using OrderedDataStores to make in-game leaderboards

Hey, so it’s been quite awhile since I’ve worked with OrderedDataStores, and just had a question on how I could efficiently make this work for an in-game leaderboard.

So, I think I understand. But the way I see it, it seems quite ineffective to make different OrderedDataStores depending on each stat. Like, I’m gonna make a leaderboard for players with the most kills, and most wins. And from what I’ve heard, values in OrderedDataStores can only be integers, so therefor, it seems impossible to make this more efficient.

Thanks!

EDIT: Just wondered if there’s even a way to make this more efficient. If not, just let me know and I’ll simply just create multiple datastores. :slight_smile:

Just use multiple and don’t let them update at the same time to spare requests.
I have like 7 leaderboards using OrderedDataStores, works like a gem.

2 Likes

Hm, I see.

Thanks!

Hey, just a quick follow-up question, but I’ve been thinking, how could I make it so it display’s the player’s username? Example:

PlayerGuy has 24 wins

I mean, if I set the key of the datastore to each player’s username alone, that wouldn’t be a good way to do it as if they change their username the data will be wiped. Any ideas??

Datastores should always use UserId

Then you just use GetNameFromUserIdAsync

2 Likes

Thanks! Just what I was looking for.