Hi there! I'm trying to mess around with different ways for storing data via DataStore without saving each value individually. Someone I know had suggested trying to save it all with a table, so I'm trying to do that. However, I'm a bit confused as to how I would use table.insert(), or anything else to add the name of the value, and the value itself to the table? Any help is greatly appreciated. :)
What I want:
local Table = {
["Cash"] = 0
}
Script I've tried using:
local Table = {}
for _,v in pairs(Player["leaderstats"]:GetChildren()) do
table.insert(Table, {[v.Name] = v.Value})
end

2 comments
Just do Table[v.Name] = v.Value
In the example you gave, you were inserting a table into Table.