Hello! Currently I’m trying to make a leaderboard system for my game. This would be a list of the top 100 players with the most cash. (This game uses the Steal a Thing kit by aGoldenMilk)
The current issue I’m facing is that the OrderedDataStore feature is capped by the integer limit, and I’m using numbervalues. The game is meant to have big numbers so I can’t use integer values.
I’ve tried searching on the devforum but I haven’t seen any topics about this. I also even tried asking ChatGPT (
).
If anyone needs any of the modules I’d be happy to give them.
local DataStoreService = game:GetService("DataStoreService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserService = game:GetService("UserService")
local Numbers = require(ReplicatedStorage.Modules:WaitForChild("Numbers"))
local MoneyOrderedDataStore = DataStoreService:GetOrderedDataStore("Money")
local MoneyLeaderboard = script.Parent
local MoneyLeaderboardGui = MoneyLeaderboard:WaitForChild("MoneyLeaderboardGui")
local MoneyLeaderboardFrame = MoneyLeaderboardGui:WaitForChild("MoneyLeaderboardFrame")
local ItemsContainer = MoneyLeaderboardFrame:WaitForChild("Items")
local ItemTemplate = script:WaitForChild("Item")
local Updating = false
local function UpdateMoneyLeaderboard()
if Updating then return end
Updating = true
for _, Item in ipairs(ItemsContainer:GetChildren()) do
if Item:IsA("Frame") then
Item:Destroy()
end
end
local Success, Page = pcall(function()
return MoneyOrderedDataStore:GetSortedAsync(false, 100, 1)
end)
if not Success or not Page then
Updating = false
return
end
local Data = Page:GetCurrentPage()
for Index, Entry in ipairs(Data) do
local UserId = tonumber(Entry.key)
if UserId and UserId > 0 then
task.spawn(function()
local Item = ItemTemplate:Clone()
Item.LayoutOrder = Index
Item.Parent = ItemsContainer
Item.Index.Text = "#" .. tostring(Index)
Item.Money.Text = string.format("$%s", Numbers.Format(Entry.value or 0))
local Thumbnail = Item:FindFirstChild("Thumbnail")
if Thumbnail then
Thumbnail.Image = string.format("https://www.roblox.com/headshot-thumbnail/image?userId=%d&width=420&height=420&format=png", UserId)
end
local UserSuccess, Info = pcall(function()
return UserService:GetUserInfosByUserIdsAsync({UserId})
end)
if UserSuccess and Info and #Info > 0 then
local User = Info[1]
Item.Name = User.Username
Item.Player.Text = string.format("%s (@%s)", User.DisplayName, User.Username)
end
Item.Visible = true
end)
task.wait(0.1)
end
end
Updating = false
end
while true do
pcall(UpdateMoneyLeaderboard)
task.wait(60)
end