Thank you for sharing this. Now I'm wondering instead of upgrading the items, is it possible to switch/replace the items with another vanilla items instead? Like for example when a butter knife is spawned, is it possible to make it so that there's 10% chance that it will be replaced by jar lids instead? Or when a Farming for Beginner book is spawned is it possible to make it so there is 5% chance it will be replaced by Herbalist magazine?
And regarding the weapons durability, is it possible to adapt it to let's say the vehicle parts durability? For example to change the durability of all vehicles when going off road or just the general durability condition like increasing the speed check from 10mph to 30mph etc.
I have zero knowledge of Lua. I can read your code and guess what it does but have no idea how to write one myself. ;p