So, I have been making some progress on a new game I'm making, but when I tried making a datastore to save a value that determines whether the player has bought a map, it does not save.
To determine if the player has bought a map, I use BoolValues that save through a Datastore. If the value is false, then the player doesn't have it. If the value is True, the player does have it. But, every time I and my Testers play the game, the datastore never saves and the game makes us purchase the Map again with In-Game currency. This is very frustrating and I am trying to find a way to fix this.
All the BoolValues to save the Maps are located in the ReplicatedStorage
Here is my Datastore Script:
local mds = game:GetService("DataStoreService"):GetDataStore("MapDataStore1")
local rs = game:GetService("ReplicatedStorage")
game.Players.PlayerAdded:Connect(function(plr)
wait()
local key = "user_"..plr.UserId
local mapsave1 = rs.PurchaseSaves.Map2Purchased
local mapsGetSaved = mds:GetAsync(key)
if mapsGetSaved then
mapsave1.Value = mapsGetSaved[1]
else
local MapsForSave = {mapsave1.Value}
mds:GetAsync(key, MapsForSave)
end
end)
game.Players.PlayerAdded:Connect(function(player)
local mapsave1 = rs.PurchaseSaves.Map2Purchased
mds:SetAsync("user_"..player.UserId, {mapsave1.Value})
end)
When I Test and Play the game, it never shows any errors. Any help?

2 comments
Are you using any other libraries for DataStore, or Roblox's default DataStore? GetAsync only accepts one argument and on line 16 you provide two. Also, are there any erorrs in the output (you can reach this in game by pressing F9)
I am using Roblox's Default DataStore.