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
Desired output
Burger, Category_Food OR Burger, Food WoodenPlank, Category_Objects OR WoodenPlank, Objects
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