What do you want to achieve?
Basically currency leaderboard
What is the issue?
Too much decimals in value
What solutions have you tried so far?
I tried search for some solutions but didnt saw anything that could help me.
local ds = game:GetService("DataStoreService")
local M = require(game.ReplicatedStorage:WaitForChild("ModuleScript"))
local blocksODS = ds:GetOrderedDataStore("CurrencyStats1")
local timeUntilReset = 60
local function update()
for i, plr in pairs(game.Players:GetPlayers()) do
for i, leaderboardRank in pairs(script.Parent:GetChildren()) do
if leaderboardRank.ClassName == "Frame" then
local success, errorMsg = pcall(function()
local data = blocksODS:GetSortedAsync(false, 25)
local blocksPage = data:GetCurrentPage()
for rankInLB, dataStored in ipairs(blocksPage) do
local name = game.Players:GetNameFromUserIdAsync(tonumber(dataStored.key))
local blocks = dataStored.value
local template = script.Template:Clone()
template.Name = name .. "Leaderboard"
template.PlrNameTemplate.PlrName.Text = name
template.RankTemplate.Rank.Text = "#" .. rankInLB
template.CurrencyTemplate.Blocks.Text = M.ZeroTwoIsCute(blocks)
template.Parent = script.Parent
while wait(1) do
timeUntilReset = timeUntilReset - 1
script.Parent.Parent.ResetTime.Text = "Resetting in " .. timeUntilReset .. " seconds..."
if timeUntilReset == 0 then
timeUntilReset = 10
I am so sorry for reviving this post but something is not right when I had small number like 75.241 it worked fine but In my game I often get to value 75.2415687459718489 something like this basically and Error appear again any solution for that many decimals (25) as I counted in game?
There is a problem with the idea you suggested if people’s data was already stored and they haven’t joined the game to update their data, the data glitches out and goes to a completely different number.