Say hello to ‘Create Leaderboard’!
Create Leaderboard is a free module script that allows you to make leaderboards without OrderedDataStore, and saved values can go over 9.223Qi!
The Create Leaderboard script only accepts number values. Do not try to save string values, because it might break.
How To Use
Example script (only works on serverside):
local createLeaderboard = require(workspace.CreateLeaderboard) -- path to module
local longestTimeData = game:GetService("DataStoreService"):GetDataStore("LongestTime")
local updateLongestTimePlayed = createLeaderboard:Create({ -- this returns a function. when called, it will update the leaderboard. every part of it is required, don't leave them blank.
Value = "leaderstats.TimePlayed", -- path to value in player
DataStore = longestTimeData, -- datastore you will use for leaderboard
Key = "Leaderboard", -- key for saves
MaxLength = 100, -- max length for values on leaderboard
UsernameTextName = "PlayerName", -- the label name for the players name on your template
RankTextName = "Rank", -- the label name for the players rank on your template
ValueTextName = "Value", -- the label name for the players value on your template
Leaderboard = script.Parent.TimePlayed, -- path to leaderboard
MainFrame = script.Parent.TimePlayed.SurfaceGui.Frame.ScrollingFrame, -- path to mainframe on leaderboard (it will add templates there)
Template = script.Parent.Template, -- path to template
FormattingStyle = function(value) -- if you want to format values shown on the leaderboard, the script will call this function
return value -- my script does not have formatting, so you just put "return value"
end,
})
game.Players.PlayerAdded:Connect(function(player) -- sets up values
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
local timePlayed = Instance.new("NumberValue")
timePlayed.Name = "TimePlayed"
while game.Players:FindFirstChild(player.Name) do
wait(1)
timePlayed.Value += 1
end
end)
-- this is the fun part; this part of the script updates the leaderboard
updateLongestTimePlayed() -- updates leaderboard before loop starts
while wait(60) do -- updates leaderboard every 60 seconds
updateLongestTimePlayed()
end
Get it here!
https://www.roblox.com/library/6148733478
Feel free to ask questions! This is my first post like this, so your support is very helpful.