Math.huge doesn't working

Hi, I’m making game that have leaderstats, and want to have Inf money on it, but game.Players.GamesVitaliy.leaderstats.Money.Value = math.huge isn’t working, and giving -92000000000… money on my account, so, is there’s any another ways to have Inf value?

1 Like

Hello,
You can either set it incredibly high: 9999999999999999999999999999999999999999999999999

Or

You can script it in so your UserId or Username is bypassed:

if playerInstance.UserId ~= 345345 or playerInstance.Name ~= `GamesVitaliy` then
   --// spend money....

It’s not the problem, I want to know how to gave me inf money via game console

I mean, same instance applies, you could probably just do this:

game.Players.GamesVitaliy.leaderstats.Money.Value = 999999999999999999999999999999999

Or to make it neater (still does the same thing)

game:GetService(`Players`)["GamesVitaliy"].leaderstats.Money.Value = 999999999999999999999999999999999

Thanks, but it showing -9223372036854776000

If it does not work and you cannot spend this money then I suggest lowering the number a bit.

Some information on the max number.

I’m do it, but I need to know how to make real inf money, that isn’t decreasing every time when I buy smth

The only way to do that really is like you first stated math.huge or my patch:
However, having a large quantity of money that will hardly go down is also the best option I can provide.

Thanks, but I’ll make a script that sets my money value to 10000000000000000000 when money is decreased

2 Likes

Maybe you can use a ModuleScript or a script where a function is called anytime money increases or decreases and just skips it for you (does not change your money, but also does not check if you have enough) and then initally set a high value for yourself.

// EDIT: Ah lol, you also just commented that xd

1 Like

Use inf. See, floating-point numbers (Roblox’s case) supports some special constants. One of them is NaN, for example. The constant you’re looking for here is inf. I’m fairly sure it is the same thing as math.huge, but try it out nonetheless.

Also, instead of checking your username, maybe use game.CreatorId.

1 Like

I think that it is the easiest solution:

game.Players.PlayerAdded:Connect(function(Player)
if Player.Name == “GamesVitaliy” then
Player:WaitForChild(“leaderstats”):WaitForChild(“Money”).Changed:Connect(function()
Player.leaderstats.Money.Value = 80000000000000000000000
end)
end
end)

1 Like

Right, good catch! That should work!
Also, thanks :slight_smile:

1 Like

Oh, I can make a level system rn!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.