[NEW] GLeaderboard - An easy way to create your Global Leaderboard!

Introduction

This model and ModuleScript will help many developers when creating Leaderboard, it works with DataStoreService, fetches the data from your DataStore and sorts it in descending order.

How to use GLeaderboard?

GLeaderboard was published to Roblox through a Model, it contains 3 different objects:

  • ’Leaderstats’: GLeaderboard already contains its own Leaderstats created, it can be changed to suit the developer who uses it, in the same way, you can create your own Leaderstats, and use GLeaderboard through require (). I suggest putting it in Server ScriptService.

  • ’Leaderboard’: This is the main board, it must be placed in Workspace, otherwise GLeaderboard will not work.

  • ’README’: A guide within a Script, which helps in the placement of all objects in their corresponding directories.

Using GLeaderboard Module

The module was created with OOP, so it contains different useful methods, which are:

local GLeaderboard = Module.new(Leaderboard Part: instance, Leaderstats Name: string, Items: IntValue, Refresh Time: IntValue).

With Module.new() you can customize the leaderboard with your own Leaderstats.

GLeaderboardModule:UpdateData() --> This is connected with the constructor .new()

Module:UpdateData() updates the Leaderboard positions, it is connected with the Update Time set with Module.new()

Links

I hope this is useful to you, I leave you my portfolio, I currently have the commissions open to all public.

23 Likes

Here’s an example: Screenshot - f31780bd34b201018d5f188f25d4e7a8 - Gyazo

I understand that it is basic, it is the first Model that I launch to the community, little by little, birndare advanced services.

2 Likes

This looks helpful! I’ll try this out!

1 Like

It seems to work even with datastore2, but I’ve run into some bugs like double player stats (e.g., Xaioro - 50 points, Xaioro - 50 points, etc.) or stats to only the top 10 players. I’m suggesting making the leaderboard wall a scrollable UI and making it handle a lot since I have a big game and it’s getting some bugs in the global leaderboard because of the number of players.

1 Like

Looks awesome!

Any way to make the sorting a bit different, if so, I might use this for my game, as I need a good reliable speedrun leaderboard.

I’ll do some in-depth searching of the code later but yeah.

Example:

Player 1 | 30.2
Player 2 | 60.43
Player 3 | 180.25

1 Like

Yes, that’s a nice idea, and thanks for your comment! You would have to change your leaderstats, GLeaderboard may store decimal numbers. The system of it is the next: It get the leaderstats name passed through arguments in :SetData(), and gets the data from the Object. Then, it stores the data into OrderedDataStore.

GLeaderboard Update! - July 8th, 2021

I have updated the Module constructor, and added new parameters.
Old:

Module:SetData(Leaderboard Part: instance, Leaderstats Name: string, Refresh Time: IntValue)

New:

Module.new(Leaderboard Part: instance, Leaderstats Name: string, Items: IntValue, Refresh Time: IntValue)

Now you can customize the number of items!

By the suggestion of @Xaioro, I added a new option to set a number of items, by using Module.new().


New updates coming soon!

3 Likes

How do I update two leaderboards at the same because it only updates one leaderboard?

Script

local TotalCashLeaderboard = Leaderboard_Module.new(TotalCashModel, "Total Cash", 10, 10)
	TotalCashLeaderboard:UpdateData()
	local TotalDiamondsLeaderboard = Leaderboard_Module.new(TotalDiamondsModel, "Total Diamonds", 10, 10)
    TotalDiamondsLeaderboard:UpdateData()
1 Like

I think the biggest downside to this is how it doesn’t seem to have easily-editable UI. I think that making a customization option would help so that we can make a leaderboard that fits a certain game style.

you can customize the ui easily

I mean built-in features to make it easy. The only way is to fork the module which is just a pain to deal with. If I was able to easily set something like the frame that lists the players, or the textlabel that has the players name, etc. that would be helpful.

yeah that would be helpful if he added that.

2 Likes