I have a data storage system that relies on a library of folders. It’s being used in a fortnite esque game, so it saves things such as a players skins and melees.
It creates a nestle of folders under the player, Playerdata > Inventory > Categories of Items > Items > The Items Values. However, when I try changing one of those values in game, it doesn’t save when I close roblox.
When I change it in studio with a datastore plugin, it works and saves for next time I play.
I only have this issue when changing values, not when adding or removing folders, so I’m fairly sure it isn’t the underlying data saving method.
Could this have something to do with the fact that the values are changed from a local script, while the folders are added from a server script?
Yes, if you are changing data from the client, those changes will not be replicated to the server. Once your player leaves the game, the PlayerRemoving event is triggering the data store save. As it loops through all of the folders to save the data on the server, there are no changes made. This is due to FilteringEnabled, Roblox’s way of preventing clients from changing server data. Without this, an exploiter could give themselves all of the skins in the game for free without purchasing them from your shop. In order to make changes to player data that you want to save, you must do it on the server. This is where remote events come in handy, a way to communicate between the client and server. I recommend using YouTube to research the client-server dynamic as it is vital to understanding how Roblox games work. Keep up the great work!