Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can you tell Data usage? [Solved]

So basically, my question is as stated. How can I tell the amount of data units something takes up? I'm trying to use Data Persistence to save places when players leave my game.

(To check that out to see what my problem is, go here and try to build something that's decent sized, leave, and come back. If you built enough, it shouldn't have saved)

Anyways, I know that I should probably use Data Stores for saving things that are this large, but I just want to make sure that my problem is what I think it is. If anyone could help me, or possibly leave an example script, that'd be awesome. Thanks in advance to whoever may help :P

1 answer

✓ Accepted answer

There is no way to actually measure the amount of data units there are in-game


But, the closest thing is using the DataCost member of instances. This can read how much data(in units) will be used while saving with Data Persistence, but it cannot be used in a script or localscript - only through the Command Bar or Plugins.


To get around this, then just use DataStores as they have pretty much unlimited storage and you won't lose data.


But there's a setback while using DataStores to save instances, you cannot directly save Instances through DataStores.. so you're going to have to constuct a lua compiler(make a table inside of the main table for every instance you're saving, this table will include every property of the instance). Then when the player joins, iterate through these tables and create instances according to the saved data.

2 comments

1

Ok, well that sucks lol. Thanks for the answer, and also giving me a start on how to go about saving an Instance in DataStore. I was trying to figure that out, which was the main reason I didn't want to use Data Store. Anyways, thanks again :P

1

Anytime(:

This discussion is preserved as it was. New answers, comments, and votes are closed.