Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Cannot Store Array in DataStore? Cannot Store Dictionary in DataStore?

Asked by 4 years ago

So, I've got a problem here... up until I added 3 new values for my customization, my datastore was working fine. Now it seems that I keep getting this new error "Cannot Store Array in DataStore?". I left and rejoined a few times and now I get "Cannot Store Dictionary in DataStore? " (or something like that). Can anyone help? The problems are Line 138 and Line 157

local DSService = game:GetService("DataStoreService"):GetDataStore("imamngrry")
local RunService = game:GetService("RunService")

game.Players.PlayerAdded:Connect(function(plr)
    local uniquekey = 'id-'..plr.userId
    local leaderstats = Instance.new("Folder", plr)
    local Level = Instance.new("IntValue")
    local EXP = Instance.new("IntValue")
    local MaxEXP = Instance.new("IntValue")
    local Cash = Instance.new("IntValue")
    local FactionEXP = Instance.new("NumberValue")

        local Strength = Instance.new("NumberValue")

        local DoubleEXP = Instance.new("NumberValue")

        local Stamina = Instance.new("NumberValue")
        local Defence = Instance.new("NumberValue")
        local Quirk = Instance.new("StringValue")
        local Points = Instance.new("NumberValue")
        local Spins = Instance.new("NumberValue")
        local RSpins = Instance.new("NumberValue")
        local SRSpins = Instance.new("NumberValue")
    -----------------------------------------------------------------------------
    -- CUSTOMIZATION --
    local SkinTone = Instance.new("BrickColorValue")
    local Hair = Instance.new("StringValue")
    local HairClr = Instance.new("BrickColorValue")
    local Shirt = Instance.new("StringValue")
    local Pants = Instance.new("StringValue")
    local Face = Instance.new("StringValue")
    -----------------------------------------------------------------------------   
    local New =  Instance.new("BoolValue")

    local Q03 =  Instance.new("BoolValue")
    local Q04 =  Instance.new("BoolValue")

    leaderstats.Name = "Data"
    Level.Parent = leaderstats
    EXP.Parent = leaderstats
    MaxEXP.Parent = leaderstats
    Cash.Parent = leaderstats
    FactionEXP.Parent = leaderstats
    New.Parent = leaderstats
    Q03.Parent = leaderstats
    Q04.Parent = leaderstats

    DoubleEXP.Parent = leaderstats

    Strength.Parent = leaderstats
    Stamina.Parent = leaderstats
    Defence.Parent = leaderstats
    Quirk.Parent = leaderstats
    Points.Parent = leaderstats
    Spins.Parent = leaderstats
    RSpins.Parent = leaderstats
    SRSpins.Parent = leaderstats

    SkinTone.Parent = leaderstats
    Hair.Parent = leaderstats
    HairClr.Parent = leaderstats
    Shirt.Parent = leaderstats
    Pants.Parent = leaderstats
    Face.Parent = leaderstats

    Level.Name = "Level"
    EXP.Name = "EXP"
    MaxEXP.Name = "MaxEXP"
    Cash.Name = "Cash"
    FactionEXP.Name = "FactionEXP"

    DoubleEXP.Name = "DoubleEXP"

    Strength.Name = "Strength"
    Stamina.Name = "Stamina"
    Defence.Name = "Defence"
    Quirk.Name = "Quirk"
    Points.Name = "Points"
    Spins.Name = "Spins"
    RSpins.Name = "RareSpins"
    SRSpins.Name = "SuperRareSpins"

    SkinTone.Name = "SkinTone"
    Hair.Name = "Hair"
    HairClr.Name = "HairClr"
    Shirt.Name = "Shirt"
    Pants.Name = "Pants"
    Face.Name = "Face"

    New.Name = "New"
    Q03.Name = "CitizenQuest"
    Q04.Name = "CatQuest"
    Level.Value = 1
    EXP.Value = 0
    MaxEXP.Value = 100
    Cash.Value = 0
    FactionEXP.Value = 0
    New.Value = true

    DoubleEXP.Value = 0

    Strength.Value = 0
    Stamina.Value = 0
    Defence.Value = 0
    Quirk.Value = "None"
    Points.Value = 0
    Spins.Value = 1
    RSpins.Value = 0
    SRSpins.Value = 0

    Hair.Value = "None"
    Shirt.Value = "None"
    Pants.Value = "None"
    Face.Value = "None"

    Q03.Value = false
    Q04.Value = false

    local GetSaved = DSService:GetAsync(uniquekey)

    if GetSaved then
for name, value in pairs(GetSaved) do
    leaderstats[name].Value = value
end
    else
 local NumberFS = {Level.Value,EXP.Value,Cash.Value,FactionEXP.Value,New.Value,Strength.Value,Defence.Value,Quirk.Value,Stamina.Value,MaxEXP.Value,Points.Value,Spins.Value,RSpins.Value,SRSpins.Value,DoubleEXP.Value,Q03.Value,Q04.Value,SkinTone.Value,Hair.Value,Shirt.Value,Pants.Value,HairClr.Value,Face.Value}

        DSService:SetAsync(uniquekey,NumberFS)

    end


end)






game.Players.PlayerRemoving:Connect(function(plr)
    local uniquekey = "id-"..plr.userId
    local SaveTable = {}
for _, obj in ipairs(plr.Data:GetChildren()) do
    SaveTable[obj.Name] = obj.Value
end

    DSService:SetAsync(uniquekey, SaveTable)

end)~~~~~~~~~~~~~~~~~


~~~~~~~~~~~~~~~~~

0
I think the problem is your sending to much data, one solution is to make multiple datastores. firestarroblox123 440 — 4y
0
did not work unfortunately Busoshoaku 0 — 4y

Answer this question