How can I save a player's door data?

My end goal here is to be able to save “door data”, for example, if the user has bought entrance to another area of the map I’d like to be able to save that for the next time they join. My only knowledge on datastores only goes to saving stats like cash, xp, etc but not something like this. If someone could guide me then I’d appreciate that!

And for those who think I’m asking people to write scripts for me: No, I do not want other people to write code for me I just want to be guided!

When the player leaves, and the player data is about to save, interject a PlayerPosition variable within their data, and on next game join, set their new position to that value and set it to nil afterward.

The way I’d do it is to implement a string value, the same way with cash, xp and save the unlocked or “already bought” locations to that string value.

UnlockedPlaces = “Map1,Map2,Map3”

And then you can use string.find() to detect if the player has the map unlocked or not next time he joins.

There are other ways, and you can also do this with the table library.
I hope I understood your question properly, if you have any questions please ask!

This is a great idea! Would it be possible to save data outside of a “leaderstats” folder? I know if I were to add this along side the cash stat, the string value would appear in the tab menu.

It’s actually very simple.
Just do the same way you’d do it with leaderstats, but name the folder anything else, like ‘MapData’ and then place the StringValue into this folder, so you should have the ‘leaderstats’ and ‘MapData’ folders in the Player instance and it should only display the ‘leaderstats’ folder.

As you can see in the photo below it only displays the ‘leaderstats’ folder.
image