Basically I have a script that checks a table and depending the what’s on the table it will change a GUI, I have 2 tables set up, one that works as an “inventory” and one that works as a dictionary
I have no way of cross referencing the dictionary table and inventory table, how could I do this
Note: I already have scripts setup to do all that’s required, this is just what the table looks like right now
local data = {
Food = {},
FoodInfoData = {
Banana = {"+3 Hunger", "+1 Health"},
Apple = {"+1 Hunger", "+3 Health"},
}
}
If you get one random item through selectedItem = data["Food"], you can cross-reference it via data["FoodInfoData"][selectedItem], assuming that data["Food"] purely contains valid strings to valid food info data.
I don’t know how to reference the itemstring
Locals
local Item = FoodData.Food[1]
local ItemString = table.concat(FoodData.Food, Item)
FoodData.FoodInfoData..ItemString
Note: FoodData is the table data
This is just so much extra.
local item = FoodData.Food[1]
local itemData = FoodData.FoodInfoData[item]
You’re not supposed to concatenate them unless you wanted both the item and the data together.