When to use Datastore on a Trading system?

Currently I am creating a in game trade system and I noticed from looking through threads on here people use Datastore to store specific data during changes in a trade. What should I be saving and when?

2 Likes

Use datastore to save the changes in currency and items after the trade has been successfully conducted to act as a safeguard. Other than that, since a trading system is a per server thing, saving the trade shouldn’t be necessary.

Another thing you could use datastores for is for logging trades.

1 Like

It would be best to use a datastore to log transactions and save changes to currency / items that are processed during the exchange.

It’s usually not necessary to save and trades that have not executed yet.

1 Like

You only really need to use a DataStore when you need to save data post-exchange. Everything else can be done in-game via appropriate communication and setups. This means displaying items, facilitating trades, whatever. The only data that matters in carry-over is the completed exchange, after all.

4 Likes

Thank you guys for the advice, I will be attempting to do the DataStore portion tomorrow. I pretty much have everything else done. :smiley:

1 Like