I have a line in my code that is supposed to save a table that is erroring. The error is, "Cannot store Array in Datastore" Here is my script,
game.Players.PlayerAdded:connect(function(plyr)
while true do
wait(60)
local build=script.Parent
local pur=build.purchased
local DataStore = game:GetService("DataStoreService")
local PlayerData = DataStore:GetDataStore("PlayerData")
local PlayerD
local pnumb=#pur:GetChildren()
local purs=pur:GetChildren()
local cframes={}
local number=0
for i=1, pnumb do
number=number+1
local item=purs[number]
local cframe=item.PrimaryPart.CFrame
table.insert(cframes,number,cframe)
print(item.Name)
print(cframes[number])
end
PlayerData:SetAsync(("OBJECTS".. plyr.UserId),purs)
end
end)
I have no idea why this is erroring as i thought that tables could be saved with datastore. An explanation could be good.

1 comment
ds:SetAsync(key, {v3.x, v3.y, v3.z})