When a vending machine is bought how to make it stop and cant be bought when it is bought

When the item is bought, deactivate the vending machine.

Should be player scoped, remember that.