Script to handle purchases

Hello, I’m making an in game store, and I seem to have hit a “roadblock” in my production. I’ve set up a currency that is earned in-game and then added some DontDestroyOnLoad instances to carry over my earned currency into the store, but whenever I try to buy something, regardless of how much money I have, the purchase is always successful. Any ideas on how to fix it?

Are you checking to see
if(playerCurrency >= storeItemCost)
{
PurchaseItem()
}

This is what it sounds like.

Thanks for the script!