simply check if the gold variable [heroIndex] is higher than the price of item bougjt. and then remove the ammout from the variable.
if you need the whole trigger done tell me and i can post it here
To share gold with triggers you have to, manually set the gold bounty for each unit or detect the bounty received by the killing unit from the object editor (by detecting the difference between his gold before and after the kill, then dividing it by 2, and giving it to everyone in range).
Chaosy is up to help you If you can't do it by yourself.
if you need help tomarrow im up for it, your project seems very nice but request with p
pm insted of spamming here