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

Please help with data store Array issue and how to fix?

Asked by 5 years ago

Please help with data store help Array issue

Output [ table: 00000281E3571EB0] [103: Array is not allowed in data stores.] [Line 23]

local data_saveA=game:GetService("DataStoreService")
local data_save=data_saveA:GetOrderedDataStore("Potiontylerfire")

local Player=script.Parent.Parent.Parent
local storage=game.ServerStorage

local datasavepotion=data_save:GetAsync(Player.Name)



--checking if  save

if datasavepotion then


else
    local clone=storage.Potions:FindFirstChild("StarterPotion"):Clone()
    clone.Parent=Player.Backpack
    local savetable = {
    "StarterPotion"
    }
print(savetable)
    data_save:SetAsync(Player.Name,savetable)
end

0
That's outdated. I save arrays to datastores all the time. The reason why this doesn't work is because you cant saves an array to an ORDERED datastore. If you want to save an array, save it to an ordinary data store. mc3334 649 — 5y
0
I changed it but now it is giving "103: string is not allowed in data stores." tylergoatboy 82 — 5y
0
Yea, I was wrong. You can save tables in datastores, just not userdata. My bad. You can only save numbers in Ordered Datastores pidgey 548 — 5y

Answer this question