Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to fix a negative number on the leaderboard?

Hello, this has just came across in my game. So what happens is you can become very strong is this game, so the leaderstat name is "Strength". Problem is when you go over 1 Billion or more, it goes into a negative number. Will I have to make a custom leaderboard to fix this?

1 comment

0

The highest value an IntValue can hold is 2^31 -1, or 2,147,483,647. Creating a custom leaderboard won't change that.

1 answer

You can't have more than a couple billion since integers can't hold more, so a custom leaderboard won't help. You will just have to cap the amount of strength someone can get.

2 comments

0

There are workarounds to get what are called bigints in lua through native code. https://github.com/empyreuma/bigint.lua

0

There is a number limit to the leader board. You can't add more than 1 Billion. But if you're having issues with that you can simply Incert a script saying : if game.Players.LocalPlayer.leaderstats.[CURRENCY NAME HERE].Value > 1,000,000,000 then game.Players.LocalPlayer.leaderstats.[CURRENCY NAME HERE].Value = 1,000,000,000

This discussion is preserved as it was. New answers, comments, and votes are closed.