So basically I make a new table and insert values into it:
function save(player)
local base = player.Team.Base.Value
playerdata = {}
for i,v in pairs(base.Placed:GetChildren()) do
local pX = table.insert(playerdata, "pX" .. i)
local pY = table.insert(playerdata, "pY" .. i)
local pZ = table.insert(playerdata, "pZ" .. i)
pX = v.Position.X - base.Base.Position.X
pY = v.Position.Y - base.Base.Position.Y
pZ = v.Position.Z - base.Base.Position.Z
local sX = table.insert(playerdata, "sX" .. i)
local sY = table.insert(playerdata, "sY" .. i)
local sZ = table.insert(playerdata, "sZ" .. i)
sX = v.Size.X
sY = v.Size.Y
sZ = v.Size.Z
local rot = table.insert(playerdata, "rot")
rot = math.abs(v.Orientation.Y/90)
local shape = table.insert(playerdata, "shape")
shape = v.Shape.Value
end
local encode = HttpService:JSONEncode(playerdata)
print(encode)
ds:SetAsync(player.UserId, encode)
end
save(game.Players.Player1)
But, when I print this off here's what I get: ["pX1","pY1","pZ1","sX1","sY1","sZ1","rot","shape","pX2","pY2","pZ2","sX2","sY2","sZ2","rot","shape"] no values for the variables were saved, also the table is surrounded by brackets (Honestly no idea why this is the case, could also be the problem). This should be an expected outcome but obviously isn't working as intended: '{"pY2":4,"sX2":5,"sY2":2,"sZ2":1,"shape1":1,"pZ1":2,"shape2":0,"rot1":1,"pX1":20,"pY1":4,"pX2":20,"pZ2":2,"rot2":1,"sZ1":1,"sY1":2,"sX1":5}' Any ideas why this is the case? anything could help, Thanks.

2 comments
sadly that's not the issue, that part of the code only has to do with the naming of the variable within the table. Thanks anyways
No Problem! Thanks for letting me know :D