I’m currently working on an update to my game, and a plan I’ve had for a while is to add currency and an inventory system to my game. In depth, this would include:
Buying Currency for Robux
Buying Inventory items for currency
I’m not really sure where to start. I don’t want to overload datastores, but I’m unsure how to securely store the player’s data (currency and inventory) and keep it up to date.
So, how would I go about making a system like this?
My first attempt at a cash system was not very successful:
I’m not entirely sure how to implement these security measures, because I’m not entirely sure how to create the system. I’m more interested in concept than code, but I’m not very sure how I would properly create a system like this for security and efficiency, and not overloading datastores.
To further understand this though it would be nice to have some small code blocks to experiment with and see better how it works.
it’s pretty bad – i haven’t touched it much since that post
before even writing the currency system, I think I need to know how it will work, then I can try and implement what i know how to do, and request further help on stuff I don’t
clearly my implementation of it before was not secure, so how do you think i could do this effectively?
Server script handles the data store stuff. This includes:
initialising the data for new players
retrieving stored data for returning players
saving data for players in game
That all makes sure that players can continue where they left off from last time they played.
The server also needs to handle actually changing the data in play sessions as well. For example a player may touch a coin in the game and then receive some currency.
These in session updates usually happen frequently enough to break the limits on data store requests so a caching system is required. Examples of these are DataStore2 and ProfileService.
You’ve mentioned security issues so I’ll state a key concept that needs to be applied. The server should make the final decision on whether or not any player data should be changed and it has to account for the player being able to tell the server anything at all, true or false.