so im trying to make a food system. people grab food and get it in their inventory this is a little bit of my code:
local itemName = item.Name
local itemStat = objectStats[itemName] -- error is here
local tangible = ss.Items:FindFirstChild(itemName)
in the module script:
local module = {
["Pumpkin"] = {
["image"] = 453112717,
["edible"] = true,
["hunger"] = 12,
["thirst"] = 5,
["heal"] = 3,
["bundleSize"] = 1,
},
}
return module

6 comments
There are so many things wrong with this post, for example you do not give us the error.
its in the title
hasanchik attempt to index nil with Pumpkin is the error
objectStats is nil
Firstly, what is "ss", what is "item" and what is objectStats
also you're not using require() for that module script . unless its in the bit you didnt show. If its there ignore me lol