Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to fix a negative number on the leaderboard?

Asked by 7 years ago

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?

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. awfulszn 394 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

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.

0
There are workarounds to get what are called `bigints` in lua through native code. https://github.com/empyreuma/bigint.lua User#18718 0 — 7y
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 wilsonsilva007 373 — 7y
Ad

Answer this question