0

I am trying to use BigNum in roblox lua so I can go past the max number for int values in roblox, however I can't figure out it works. The library is not very descriptive or informative:https://rostrap.github.io/Libraries/Math/BigNum/ I have searched the internet for any tutorials or just an explanation of it but I have come up empty handed. If you know how please respond to this.

2 Answers2

0

The library is well documented. I'm not sure what you expect. If you get to a point where you need something like this you should know enough to make sense of such a reference.

They list the API functions and show how to use it. They even give examples.

The library is being loaded using Resources:LoadLibrary which is deprecated and has been removed a year ago.

https://devforum.roblox.com/t/loadlibrary-is-going-to-be-removed-on-february-3rd/382516

Piglet
  • 27,501
  • 3
  • 20
  • 43
  • Looking at the [RoStrap source code](https://github.com/RoStrap/Resources/blob/master/Resources.lua) for Resources.lua, `Resources:LoadLibrary()` is not calling the lua function LoadLibrary which, you are right, has been officially deprecated from Roblox. Instead it is a bootstrapper for downloading source code from GitHub and loading it using `require`. – Kylaaa Jan 09 '21 at 19:29
0

I can see how you had a hard time with this. BigNum is a one of the many libraries managed by RoStrap. Ideally, you would use the RoStrap Package Manager plugin for Studio to include this library, but a recent security update prevents the loading of 3rd party code without explicit user consent, and now that plugin seems to be broken.

But, you could still get access to the code manually. RoStrap uses a manifest file of all of the different libraries it supports on its Library page. And looking inside Libraries.lua...

BigNum = {
    URL = "https://raw.githubusercontent.com/RoStrap/Math/master/BigNum.lua";
    Documentation = "https://rostrap.github.io/Libraries/Math/BigNum/";
    ParentFolderPath = "Math";
};

There is a link directly to the source code of BigNum.lua.

So if you want to integrate it into your game, follow these steps :

  1. Create a ModuleScript somewhere, like ReplicatedStorage
  2. Copy the source code from BigNum.lua into it.
  3. Use require(<path to BigNum>) to load the code into your Script or LocalScript

And that should be all you need to start using it.

local BigNum = require(game.ReplicatedStorage.BigNum)
local result = BigNum.new(1) + BigNum.new("2")
print(result) -- 3
Kylaaa
  • 6,349
  • 2
  • 16
  • 27