I am trying to save data in a datastore for an RPG that I have created. However, there is an error that says the following:
Cannot save Dictionary in DataStore
When I have this code already mapped out below to where it was legit before:
local DataManager = {
}
function DataManager:saveScores(ds1,player,pvp)
ds1:SetAsync(player.Name.."-id",{
Lvl = player.leaderstats.Lvl.Value,
XP = player.leaderstats.XP.Value,
Gold = player.leaderstats.Gold.Value,
Attributes = {
Strength = player.attributes.Strength.Value,
Constitution = player.attributes.Constitution.Value,
Intelligence = player.attributes.Intelligence.Value,
Dexterity = player.attributes.Dexterity.Value
},
Armor = {
UnlockedLeather = player.UnlockedArmor.UnlockedLeather.Value,
UnlockedChainmail = player.UnlockedArmor.UnlockedChainmail.Value,
UnlockedIron = player.UnlockedArmor.UnlockedIron.Value,
UnlockedSteel = player.UnlockedArmor.UnlockedSteel.Value,
UnlockedMithril = player.UnlockedArmor.UnlockedMithril.Value,
UnlockedDemonic = player.UnlockedArmor.UnlockedDemonic.Value,
UnlockedBone = player.UnlockedArmor.UnlockedBone.Value,
EquippedArmor = player.Stats.EquippedArmor.Value
},
PVPScore = pvp
})
print("============================")
print("=========DATA CHECK=========")
print("============================")
print("1. Stats saved successfully!")
print("2. Attributes saved successfully!")
print("3. Armor saved successfully!")
print("4. PVP Score Saved")
print("DATA CHECK SUCCESSFUL!!!")
end
return DataManager
What am I doing wrong?
