How to set an infinite value in an IntValue

Hello, so i’m trying to set a infinite value in an IntValue but adding a lot of 9 or using math.huge doesn’t work. Is there another way to do it?

I’ve tried using this but it sets the value to 0.

    local MAX = Instance.new("IntValue", Backpack)
	MAX.Name = "MAX"
	MAX.Value = math.huge
4 Likes

If I may ask, why do you need this? I can maybe help you better if I understand what you’re trying to do.

for an infinite backpack storage game pass

So, you can either just set it to the maximum value a number can be in Lua, which is something like 2 billion, or if you think anyone would ever eclipse that (they won’t) you could use a boolean value.

IntValue’s have a maximum integer of 9223372036854775807 (2^63 - 1). That is an insanely high value and I don’t think under normal conditions someone would reach that.

Also if you are worried then try setting the “weight” of something in their inventory to 0.

9 Likes

If you post your code that handles the gamepass I can tweak it a bit to make it infinite storage, but I think it isn’t necessary to store math.huge in any way, you could simply just create a condition statement seeing if the gamepass is owned by the player, and then allow the player to keep adding more items to their inventory.

5 Likes