Hello, i have need some help to put key named with a variable inside a table, here the issue:
local module = {}
local Inventory = {} --The table that store all the ressource
function module.Handle(plr)
local playerInventory = plr.Inventory
for i,v in pairs(playerInventory:GetChildren()) do
print(v.Name) --print "Stone", and "Wood" for the second turn
Inventory.v = 50 --over here it put the "v" key with 50 as value inside Inventory, but it should put v.Name (so Stone)
end
print(Inventory) --print { ["v"] = 50 } instead of this: { ["Stone"] = 50, ["Wood"] = 50 }
end
return module