Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Best method of saving data in a shop GUI?

Asked by 6 years ago

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.

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. Meltdown81 309 — 6y
0
if I helped you out please accept my answer otherwise comment how I can help you better User#21908 42 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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.

Ad

Answer this question