on *:TEXT:!buy*:#:{
set %buying $+ $nick 1
msg $chan Welcome $nick What would you like to by?
notice $nick Blue Potion 500coins Restores 10HP
notice $nick Crystal Blue Potion 1000coins Restores 50HP
notice $nick Heal Potion 3000coins Restores 150HP
notice $nick Elixer of Heal 10000coins Restores 5000HP
}
on *:TEXT:Blue_Potion:#:{
if ( $eval(% $+ buying $+ $nick,2) == 1 ) {
notice $nick You have bought a blue potion!
unset %buying $+ $nick 1
}
}

When someone types !buy it sets a variable to say they are buying something.

When someone types blue_potion it unsets the variable and tells them they have bought it...if this isn't it I give up..