Hi there. I’ll keep this short and sweet. I’m making a story game that is considerably long, and I want to put a system in place. Right when the player joins, I have a main menu that is simple – it has the common ‘‘play, settings, quit’’ buttons. If the player hits play, they will go through the story fine if they play through it all in that day – but if someone gets bored, and decides they don’t want to finish the game, they will be forced to leave and have all of their progress erased because there is no saving system.
This is where I am confused. Is there a way to, when the player hits the play button, it pops up with a ‘‘create your profile’’ section, where a name can be entered? That way, when the player goes through the game normally – every piece of data is being saved to that profile. My goal is when the player leaves, their data will save to that profile, the profile will save, and when they rejoin and hit play again, it will give them the ‘‘continue game’’ section, with their already created profile. Think of it like any story game outside of Roblox.
How would I go about this? I’m aware of the DataStore feature, however, I haven’t seen anything directly mention a kind of ‘‘save to profile’’ system. I’d appreciate any and all help. Thank you!
I recommend watching a few tutorials on DataStores first to get a grasp of their applications/how they work/how you would use them to fit this specific use case etc.
Retrieve the datastore value associated with the players ID when they join the game.
a. If nothing exists, I.e. the datastore value is nil, then nothing has been saved yet so they have never played before, so display “Start New Game” on the menu. You can use Remote events to tell the client to display this.
b. If something exists then they have already started a new game, so the menu should say “Continue”
Save the players progress when they reach a checkpoint or a cutscene or whatever, or when they first enter their name. You can save it as a table as to allow the easy saving and loading of lots of different data at once
I recommend using a datastore service like ProfileService, as it makes the whole process a lot easier. I recommend you look up tutorials as other people have mentioned, because it would take too long to explain how to use it here.