local Tab = {Inventory = {}, Backpack = {}}
local Data = {Inventory = {'G','S','F','A'}, Backpack = {'G','S','R','F.',"A"}}
for i,v in pairs(Data) do
if Tab[i]then
for c,d in pairs(v) do
table.insert(Tab[i],d)
end
end
end
---
for i,v in pairs(Tab.Backpack) do
print(i,v)
end
for i,v in pairs(Tab.Inventory) do
print(i,v)
end
Im trying to insert everything according to the keys this is for a datastore
But I was wondering if there was a simpler way to do this

1 comment
You could just do arrays but that would take up far too much time