So lets say that I have a table, and I want to add two new keys Item.
local Table = {}
local Items = {
['Item'] = nil
}
They should both share the same key name Item. Currently, I’m using a workaround to make the keys named correctly. The following function clones the key from table Items to Table:
local RequestedName = 'Item'
local RequestedItem = Items[RequestedName]
local TempData = table.clone(RequestedItem)
Table[RequestedName] = TempData
table.remove(Table, Table[TempData])
This works for one use, but my problem lies in the fact that this will not create the second key with the same name, but instead overwrite the original key. How could I make this work as intended?
Any help would be much appreciated!