First, to help with lag and help with limiting crafting conditions, we can take this repeated section of code and make it into it’s own function:
This way, we can simplify the ‘Collect item’ and ‘Lose item’ functions into this:
So we can easily modify the craft function to check for the number of materials:
Here’s the link to add this function!
The lag issue is a harder one to fix, but there are helpful tips in this thread!