hello! today i am releasing an old-ish module that ive held on to for a while.
it’s designed to work as a simple global leaderboard module, but instead of OrderedDataStores or anything like that it will save all players rankings in to one single table. it utilizes serialization (using DataSerializer) to minimize the tables size while it is in the datastore.
this module was made more as a proof-of-concept. i haven’t tested it in a live environment.
Get the module here!
Usage
Module.SaveServer()
Saves all data of all players in the server. You should use this directly before your leaderboards refresh.
Module.GetTop(Stat: string, Amount: number)
Returns the top Amount
number of players of a given Stat.
Notes
- This module is untested in real live environments
- This module could be improved!
- Instead of saving all players in a table, only save a truncated version of that (for example top 500)
- Checks for “dead players” (people who join and leave without gaining any stats)
- Better monthly memory store resetting. Currently, it’ll attempt to delete it automatically by retrieving the timestamp of the end of the month, using memorystores built-in
expiration
argument, however times may be off (needs testing)
overall, I think that this concept is pretty cool and I could definitely see it be used, with the right changes made! Looking forward to see who can expand on this