If im at 9qn it goes back to 0 why? i dont know but how please help i was gonna release my game
Change your IntValues into NumberValues and the problem will disappear.
Note that Lua integers can only be accurately represented up to 2^53. You can test this by running this line in the command bar: print(2^53 + 1 == 2^53)
- it'll print true
.
You have a few options:
1.234
in one variable and 6
in another (the 6 representing how many digits there are to the right of the number). As the number you wish to store increases/decreases, keep adjusting the magnitude variable so that your accuracy number is between 0.101 and 9.999, and your game will be able to handle almost arbitrarily large (or small) numbers! (This is how similar to how numbers are stored in Lua and other languages already, so this is only useful if you need to go even larger.)Since your problem is at that exact number, it sounds like you're using an IntValue - I just tested it; Roblox detects that you're going too high and wraps it back down to 0. Your simplest solution is to use a NumberValue instead, which lets you hold much larger numbers.
This is the 64-bit integer limit. Straight off of google, the limit is -9223372036854775807
to 9223372036854775807
. Once you surpass these limits, your number will reset.
There's no way around it (to my knowledge, at least, but I'm pretty damn sure there's no way around it), unless you try not to reach that number in your game or you create a fake number system using strings instead of numbers.