This is very technical, with nothing to visually show, but I just finished a successful test.
I don’t know if I’ve talked about it before, but I use a system that I mostly wrote by myself called “CharacterStorage” in my experience. This stores references to players’ body parts, humanoid, and other important character instances.
Yesterday, I added another reference to this structure, save data! When the player’s DataStores load successfully, they’re “linked” to their serverside character entry at [entry].Player.SaveData.[key]
(done using a new function, CharacterStorage:LinkSaveData()
, as a direct reference to the data store’s value. (I use Suphi’s DataStore Module, and I love how it integrates with my system like this.)
What about the client?
For those worrying about exploiters, don’t. The local client generates their own character entry (using the same functions), but the save data is automatically synced from the server using a RemoteEvent, updated each time that it attempts to save the data to the DataStores.
I wasn’t sure if I could update this using server scripts, so I wrote a test function today and it worked perfectly!
Also, my experience should be able to test saving, even in local multiplayer tests (the ones where players are named “Player1” and so on). If it’s one of those, it detects it and saves the data to a scope named after my user ID, plus that “player’s number” (_1, etc.). This will let me test features that involve multiple players and edit their save data.