Due the lack of information I'm just going to jump to the simplest answer.
USE THREADING
You could do something like this:
PSEUDOCODE WARNING:
MainThread:
Wait for user instructions
Lock Coins Variable
Expend their coins
Unlock Coins Variable
CoinThread:
Increase Coins all the time
Simple as that