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

Introduction of GLeaderboard

Have you ever wanted to create leaderboards? Have you found it difficult and failed in the attempt? Well today I bring you the solution!

GLeaderboard is an interactive and customizable module that will allow you to create your own Leaderboard 100% customizable to the saved data. You will be able to interact with the interface design of the board, and in addition, it will make sure that your data is safely preserved in a 2x2 sorted database.

:boom: How to use Leaderboard? :boom:

GLeaderboard was created for users who are new to the world of Roblox experiences creation, allowing the creation of leaderboards to be as simple and intuitive as possible.

STEP :one:: Creating your board

To create your first Leaderboard you must use the GLeaderboard.Createboard() method.

local GLeaderboard = require(7048780231) -- Module requiremenet.
local MyBoard = GLeaderboard.new(
	PointsLeaderboard_Part, -- Part Instance
	PointsOrderedDataStoreName, -- OrderedDataStore name (DataStoreService:GetOrderedDataStore(THIS_IS_THE_NAME))
	"Points", -- Stats value to evalue.
	0, -- Minimum stat value required to appear on the board.
	10) -- Maximum items to show.

MyBoard:UpdateBoardDisplay() -- Making the initial update on player's stats.

STEP :two:: Updating your board

while task.wait(UPDATE_TIME: number) do
   MyBoard:UpdateBoardDisplay()
end

:warning: Be aware that Roblox has quota request limits on usage of DatastoreService. More info on wiki.

Step :three:: Customizing your Leaderboard

MyBoard:SetPropertyOf(ItemToChange: "TopBar" | "Title" | "TitleStroke" | "ScrollBar", PropertyToChange: any item property, ValueToSet: any value)

:warning: Check out the type of elements below, be sure to put the correct property name of element’s (capital letters, etc).

Currently, due to a testing issue and considering that customization is a new extension, you can only customize the following features:

ELEMENT TYPE
TopBar ImageLabel
TopLine Frame
Title TextLabel
ScrollBar ScrollingFrame
TitleStroke UIStroke

An example in code of how you could customize your board would be the following:

local MyBoard = GLeaderboard.new(
	PointsLeaderboard_Part, -- Part Instance
	PointsOrderedDataStoreName, -- OrderedDataStore name (DataStoreService:GetOrderedDataStore(THIS_IS_THE_NAME))
	"Points", -- Stats value to evalue.
	0, -- Minimum stat value required to appear on the board.
	10) -- Maximum items to show.

MyBoard:SetPropertyOf("TopBar", "ImageColor3", Color3.fromRGB(232, 116, 0))
MyBoard:SetPropertyOf("TopLine", "BackgroundColor3", Color3.fromRGB(147, 74, 0))
MyBoard:SetPropertyOf("Title", "TextColor3", Color3.fromRGB(147, 74, 0))
MyBoard:SetPropertyOf("ScrollBar", "ScrollBarImageColor3", Color3.fromRGB(232, 116, 0))
MyBoard:SetPropertyOf("TitleStroke", "Thickness", 5)

:link: Useful Links

  • Module Id: 7048780231 (you should use require(7048780231) ).

I hope this is useful to you! I’ll leave my development portafolio, I have open comissions.


9 Likes

Gleaderboard Update! - October 23th 2024 » 1.2 :wink:

Hey y’all! I have finally returned to Roblox Studio, and I’ve decided to pull up a new update for GLeaderboard module. I’ve considered all your suggestions, after a extremely thorough analysis, I’ve decided to re-make the whole module, and for this reason these are the new methods:


Creating your first Leaderboard

local MyBoard = GLeaderboard.CreateBoard(LeaderboardPart: Part, OrderedDataStoreName: string, LeaderstatsName: string, MaxItemsToShow: number).
MyBoard:CreateBoardData() --> Creates the items data with the arguments given on .CreateBoard() method.

:white_check_mark: GLeaderboard now support multiple boards creation! (thanks @instanitly)


Updating your Leaderboard’s Data

local MyBoard = GLeaderboard.CreateBoard(LeaderboardPart: Part, OrderedDataStoreName: string, LeaderstatsName: string, MaxItemsToShow: number).
MyBoard:CreateBoardData() --> Creates the items data with the arguments given on .CreateBoard() method.

while task.wait(UPDATE_TIME: number) do
   MyBoard:UpdateBoardDisplay()
end

Customizing your Leaderboard

MyBoard:SetPropertyOf(ItemToChange: "TopBar" | "Title" | "TitleStroke" | "ScrollBar", PropertyToChange: any item property, ValueToSet: any value)

:warning: Check out the type of elements below, be sure to put the correct property name of element’s (capital letters, etc).

Currently, the possible attributes to modify are the next: (thanks @SpiralAPI)

ELEMENT TYPE
TopBar ImageLabel
TopLine Frame
Title TextLabel
ScrollBar ScrollingFrame
TitleStroke UIStroke

I will add more customatizable options in the future. However, for now, I think it’s enough.


Full Usage Example: :cowboy_hat_face:

local PointsBoard = GLeaderboard.CreateBoard(PointsLeaderboard_Part: Part, "PointsOrderedDataStore", "Points", 10);

PointsBoard:SetPropertyOf("TopBar", "ImageColor3", Color3.fromRGB(232, 116, 0))
PointsBoard:SetPropertyOf("TopLine", "BackgroundColor3", Color3.fromRGB(147, 74, 0))
PointsBoard:SetPropertyOf("Title", "TextColor3", Color3.fromRGB(147, 74, 0))
PointsBoard:SetPropertyOf("ScrollBar", "ScrollBarImageColor3", Color3.fromRGB(232, 116, 0))
PointsBoard:SetPropertyOf("TitleStroke", "Thickness", 5)

while task.wait(60) do
   PointsBoard:UpdateBoardDisplay()
end

PLAYER DATA FORMATTING :star_struck:

I’ve added compatibility with formatting for bigger values of player’s data. (thanks @foilplays)


Thanks a lot y’all for the suggestions. Glad to hear future suggestions to add. See y’all! :wave:

Here’s a full code with creations of OrderedDataStore (Points & Money stats). Getting and saving player’s data as well.

--// Dependencies
local PointsLeaderboard_Part, MoneyLeaderboard_Part = game.Workspace:WaitForChild("LeaderboardPoints"), game.Workspace:WaitForChild("LeaderboardMoney");
local GLeaderboard = require(7048780231)

--// Variables
local PointsOrderedDataStoreName = "PointsOrderedDataStore"
local MoneyOrderedDataStoreName = "MoneyOrderedDataStore"

--// Board Creation
local PointsBoard = GLeaderboard.CreateBoard(PointsLeaderboard_Part, PointsOrderedDataStoreName, "Points", 10)
PointsBoard:CreateBoardData()
PointsBoard:SetPropertyOf("TopBar", "ImageColor3", Color3.fromRGB(232, 116, 0))
PointsBoard:SetPropertyOf("TopLine", "BackgroundColor3", Color3.fromRGB(147, 74, 0))
PointsBoard:SetPropertyOf("Title", "TextColor3", Color3.fromRGB(255, 255, 255))
PointsBoard:SetPropertyOf("ScrollBar", "ScrollBarImageColor3", Color3.fromRGB(232, 116, 0))
PointsBoard:SetPropertyOf("TitleStroke", "Thickness", 5)

local MoneyBoard = GLeaderboard.CreateBoard(MoneyLeaderboard_Part, MoneyOrderedDataStoreName, "Money", 10)
MoneyBoard:CreateBoardData()
MoneyBoard:SetPropertyOf("TopBar", "ImageColor3", Color3.fromRGB(76, 76, 173))
MoneyBoard:SetPropertyOf("TopLine", "BackgroundColor3", Color3.fromRGB(37, 37, 84))
MoneyBoard:SetPropertyOf("Title", "TextColor3", Color3.fromRGB(255, 255, 255))
MoneyBoard:SetPropertyOf("ScrollBar", "ScrollBarImageColor3", Color3.fromRGB(76, 76, 173))
MoneyBoard:SetPropertyOf("TitleStroke", "Thickness", 5)

while task.wait(60) do
	PointsBoard:UpdateBoardDisplay()
	MoneyBoard:UpdateBoardDisplay()
end
1 Like

This seems really cool! Shocked no one else has replied on this

Hey there! Thanks for you comment, hope this feature is useful for everyone.

1 Like

Consider using OBS (or a 3rd party screen recorder) to change it to an MP4, not everyone wants to download it.

Anyway it looks pretty cool. Might use it in the future.

Thought it was already converted as I did before posting it. Thanks for the reminder, just fixed it :wink:

1 Like

Gleaderboard Update! - October 23th 2024 » 1.2.1 :partying_face:

Hey folks! Just pulled out a new update on interface design, and some other changes, these are:

  • MinimumRequiredValue will set the minimum stat value required to appear on the board.
  • MaxItemsToShow will set the maximum items to add on the board (such as Top #50 users with the most stats value).
  • The GLeaderboard.CreateBoard() now is GLeaderboard.new() (using classes build).
  • Added some padding on UI interface.

You’ll be able to set the new attributes through the creation of the board.

local MyBoard = GLeaderboard.new(LeaderboardPart: Part, OrderedDataStoreName: string, LeaderstatsName: string, MinimumValueToAppear: number, MaxItemsToShow: number).
local PointsBoard = GLeaderboard.new(
	PointsLeaderboard_Part, -- Part Instance
	PointsOrderedDataStoreName, -- OrderedDataStore name (DataStoreService:GetOrderedDataStore(THIS_IS_THE_NAME))
	"Points", -- Stats value to evalue.
	0, -- Minimum stat value required to appear on the board.
	10) -- Maximum items to show.

4 Likes

This is great, planning to use this in my future projects!

is there a way to turn this into a daily leaderboard system? unless thats already a feature

What do you mean by this? One that updates every day?

1 Like

like one that gathers the value of something players have earned in a day on the leaderboard, then at the end of the day reset it all so the players can all work up the leaderboard again, ive already tried doing this before but i cant figure out how to reset a players data when theyre not currently in game, as well as displaying the scores cross server

1 Like

Hello! I hope you are doing well. It would be quite specific to add an option to have the stored data updated at a certain time of the day, that can be done individually by the developer. I suggest you use the “live event” style option where at a certain time the leaderboard will be updated (example video https://www.youtube.com/watch?app=desktop&v=spFZ44yqIII).

On the other hand, GLeaderboard uses GlobalDataStore, and the stored data is shared between all active servers.

i am already able to do that where it resets the day leaderboard at a specific time, however my biggest issue is how im able to reset the daily values of players who arent in the game, which i have no idea how to implement, but ive tried many times now to no avail

Oooh, I have a leaderboard system set up already but I love modularity so I’m going to see if I can implement this instead.