Table used across multiple scirots, stored only once

I have a table that has about 8 megabytes and i need to access it across multiple scripts. Is there a way to store it in memory only once, or does it have to save at every script where its used?

You can use module scripts, so you can access it from other scripts.

local module = {}

module.array = {}

return module
local ms = require(game.ServerScriptService.ModuleScript)
print(ms.array)

Yes, but isnt the table going to be stored twice in the memory? My table will maybe get even bigger in the future and i want to be memory efficient.

No no, you can just keep this as the original array and insert stuff into it whenever. Modules would also be actually the most memory efficient I’m pretty sure. Since it’s just a script with minimal code, rather than maybe using bindables where you need to connect events to functions and what not.

1 Like

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