I need the button to only work when it takes money from the player

im dumb and cant firgure it out

use a vending machine or a checker

The vending machine does take away money from the player who purchases it…
And then wire the vending machine to the button. MAKE SURE THE BUTTON IS NOT ACTIVE ON GAME START. Wire the vending machine to the button
Item Purcased, Activate Button.