Hi, im trying to make an inventory system where it shows the image of the item, however when i go to add the image of the item, it gives me the error, ‘attempt to index nil with image id’
module script (stores the items and images)
m.Items = {
{
name="Dark Bandana";
imageID="17077089933";
rarityType="Common";
};
{
name="Dark Shades";
imageID="17077078542";
rarityType="Common";
};
{
name="Dramatic Mask";
imageID="17077078644";
rarityType="Uncommon";
};
{
name="Fedora";
imageID="17077078435";
rarityType="Rare";
};
{
name="Red Bandana";
imageID="17077090356";
rarityType="Uncommon";
};
{
name="Old Boot";
imageID="17077078756";
rarityType="Epic";
};
{
name="Topaz Fedora";
imageID="17077078905";
rarityType="Impossible";
};
}
local script
local UserInputService = game:GetService("UserInputService")
local template = script:WaitForChild("Template")
local List = script.Parent
local module = require(game.ReplicatedStorage.Items)
local b = require(game.Players.LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("Modules"):WaitForChild("case"))
game.ReplicatedStorage.Cases.GetItem.OnClientEvent:Connect(function(unboxed)
print(unboxed)
local button = template:Clone()
button.Visible = true
button.Parent = List
button.ImageLabel.Image = "rbxassetid://"..module.Items[unboxed].imageID -- problematic line
end)