Set score to coin amount

Hey! Is there any way to set the player score to always be the coin amount it has on its inventory?