how to create a credit system?