Hello devs! so i want to use datastore on my game. in menu place, my script creates a “data” folder at player. i dont want it to reset, and also when in main game, i want the main game to get data from menu. how can i do that?
my script:
game.Players.PlayerAdded:Connect(function(plr)
local datafolder = Instance.new(“Folder”)
datafolder.Name = “Data”
datafolder.Parent = plr
I’d strongly recommend you check out Data Stores | Documentation - Roblox Creator Hub, it contains everything you need to know to get started and includes helpful examples.
Small word of advice, please take note of ratelimits! They’re very easy to miss and you’ll regret not respecting them.
Then you probably don’t have enough experience with scripting. I recommend you checking a tutorial and understanding whats happening.
Datastores can be easy to use but also very difficult, depends on the amount of data you need to store. Most people save every part of data into its own key (<playerId>/money), sometimes it’s enough.
However in bigger games, it is recommended to save all data into JSON under one key, but then there’s limit of 4MB and data can get too big easily, so a sharding must be introduced.