Heya! I’m trying to create an all time leaderboard but I am just now realizing that ProfileService might not be able to load all profiles?
Does anyone have a workaround to get all profiles?
Heya! I’m trying to create an all time leaderboard but I am just now realizing that ProfileService might not be able to load all profiles?
Does anyone have a workaround to get all profiles?
what i do is create a separate module i call “Profiles” which i use as a table storing all player profiles. This allows all other scripts to have access to player profiles for whatever purpose. if you do that then you’ll able to loop through all profiles for whatever it is that you need.
inside the module really all you need to write is
return {}
As for all time leaderboards. Instead of trying to get all profiles what you should do is add players to the leaderboard once they join the game.
that would work, but it would not quite be “All-Time” as it only shows players in-game and not offline players.
what i mean is that you add players to the global leaderboard as they join the game. They would leave yes but their data would stay. I mean you have to do this anyway otherwise your all time leaderboard would only contain players that already had profiles at the time of making the leaderboard.
Although that is a good way to create a local leaderboard, it would not be able to actively update throughout all servers.
obviously it would. As every server would retrieve the latest data from the datastore