im too lazy to script the whole thing, but a simple note is that you will have to use serialize functions which are
table.save
table.load
this way you can store custom tables and load them later on and increase on them/reduce them upon using the npc to redeem