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

Best method of saving data in a shop GUI?

I have been having a problem with finding a good way to save a player's purchase data in the datastore. I tried to make every item in the shop have an int value then set the int value to true when the player buys the item then save the int value in the datastore, but this is just too inefficient when you have too many items in the shop.

I also attempted to make a table that has all the purchase data but I couldn't figure out how to save the table in the datastore or how to even get the table from a local script to a server script.

2 comments

0

Why not just add and save the items to the players table as they get them instead of having them all there at first? Also use remote events to communicate between the server and client if you don't need to return a value and remote functions if you do.

0

if I helped you out please accept my answer otherwise comment how I can help you better

1 answer

✓ Accepted answer

You can save your items name instead of using values. Then when you load their saved data just cycle through the table that you have saved in the datastore with a for loop. Then make a function that gives the player all their saved stuff.

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