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

How do I save objects? DataStores only save player data!

Datastores can only store player data, how would I store,for example, the amount of money a store through ALL the servers has made, by selling items? (aka global counters)

2 answers

✓ Accepted answer

You can't store Instances. Roblox doesn't serialize them, because JSON has no support for them, and Roblox doesn't support binary data structures for storage (Truth - Roblox actually doesn't like a lot of binary values).

The solution?

Store the information which describes the Instance. Is it an IntValue? Store the number. Part? Store the information to make it, such as the name of the thing you cloned it from. Weapon? Store the name. Serialization is an important part of storage which was missed out from DataStores for some unknown reason.

3 comments

0

Speaking about JSON, could I use HTTPService to achieve my goals?

0

You cannot save any objects, you can either save a table, string or a number.

DataStores can only save tables strings or numbers, no objects or classes can be stored.

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