bad argument #1 to 'sub' (string expected, got table)

Yes you are right i am adding tables into deck.card_list instead of numbers:

deck.card_list={}

table.insert(deck.card_list, card_t.new(main,suit_list[suit],number,0,0))

So, have you fixed it and gotten it working?  I’ll assume yes.

For future readers, the lesson to take away is, “question your assumptions”.  

In this case, the specious assumption was that the data in ‘deck.card_list’ was good and something was wrong with string.sub(), but in actuality, the data was bad (i.e. Tables and not numbers.).

-Ed

Meanwhile, blablu1212, keep it up and good luck with your project.