The LocalScript:
v.MouseEnter:Connect(function()
if v.ItemName.Text ~= "" then
local item = v.ItemName.Text:split(" ")
Entered = true
Info.Visible = true
v.HoverImage = "rbxassetid://5626419484"
for i, v in pairs(itemModule) do
print(i, v)
end
Info.Desc.Text = "Desc: " .. itemModule[item[1]]["Desc"]
end
end)
The ModuleScript:
local module = {
["Apple"] = {
Name = "Apple",
Amount = 1,
Desc = "A fruit that will replenish your health.",
Type = "Consumable",
Weight = 0,
Selling = 10,
Picture = 5652301921,
Dropable = true,
};
["Magic Potion"] = {
Name = "Magic Potion",
Amount = 1,
Desc = "A potion that will replenish your magic.",
Type = "Consumable",
Weight = 0,
Selling = 100,
Picture = 5651758927,
Dropable = true,
};
["Lesser Healing Potion"] = {
Name = "Lesser Healing Potion",
Amount = 1,
Desc = "Heals your health by a little.",
Type = "Consumable",
Weight = 0,
Selling = 50,
Picture = 5651758690,
Dropable = true,
};
}
return module
The Error:
17:45:16.087 - Players.iHoppier.PlayerGui.MainGui.LocalScript:209: attempt to index nil with 'Desc'
17:45:16.088 - Stack Begin
17:45:16.088 - Script 'Players.iHoppier.PlayerGui.MainGui.LocalScript', Line 209
17:45:16.089 - Stack End
