Module Scripts help

I have a Module script wich haves multiple categories such as

Category_Food {Burger, Water, Donut} ecc… and they have {hunger, stamina, model ecc…}
Category_Guns {Pistol, Minigun} ecc… and they have {Damage, model ecc…}

Now i would like to check the inventory of the player where all the models are stored to give them a category but i can’t find a way to do so

The easier way would be a for loop inside the inventory and do a
print → Module:FindFirstChild(v.Name).Parent

For example but it doesn’t work and returns a nil value

Visual Example
Immagine 2022-01-13 044745

Desired output

Burger, Category_Food OR Burger, Food
WoodenPlank, Category_Objects OR WoodenPlank, Objects

1 Like

Have you tried

Module["Category_Food"]["Burger"].Name

Yeah, the problem is that I have a folder of objects like

Inventory {
Burger
Burger
WoodenPlank
}

And that’s the player inv and from them i should be able to print their respective category

Is it returning the table? That may be your problem.

I’m using a for loop to check every item inside the inv folder but I get stuck because i can’t tell his category without using his category, a paradox

But I think i found a soution, instead of using multiple categories i could just put them all in a generic category and then check with a for loop of the string → Burger.Category is equal to the one i’m searching for.

This would make the script a little less organized but if is the only way it then is okay

What does your for loop look like?