This post is extremely useful, but in a sense I will do a rundown:
Steps:
- Build a table of formulas (X, Y, and Z make F) - You can also add grid-numbers to these as well, so X must be in the top left corner
- Once the player clicks “Craft” after placing their items, run through the formulas and check if all the ingredients and their grid position match, if so, remove the items from the player and award the item
local formulas = {
Item1 = {
Ingredient1 = {
Item = "Carrot",
Position = "TopLeft", -- or 1
},
Ingredient2 = {
Item = "Peas",
Position = "TopRight", -- or 2
},
},
}
And you’d follow this format for all items, then its a matter of an for i, in pairs loop to check if all ingredients match. Hope this helps!