function expspmerchant()
{
#onhear Merchant 20 true all "hi" >#call merchanthi ^VictimName,
#onhear Merchant 20 true all "sp" >#call merchantsp ^VictimName, ^VictimCoins,
#onhear Merchant 20 true all "exp" >#call merchantexp ^VictimName, ^VictimCoins,
#block merchanthi
#fw merchant #say Hello %1 , would you like to buy some [sp] or [exp]?
#endblock
#block merchantsp
#if {%2 > 10000} #fw Merchant #say You don't have enough coins to purchase SP.
#if {%2 < 10000} >#call givesp ^VictimName,
#endblock
#block givesp
#takethisstuff %1 COINS 10000
#addsp %1 100
#endblock
#block merchantexp
#if {%2 > 10000} #fw Merchant #say You don't have enough coins to purchase EXP.
#if {%2 < 10000} >#call giveexp ^VictimName,
#endblock
#block giveexp
#takethisstuff %1 COINS 10000
#addexp %1 500
#endblock
}
Feel free to copy and paste--I'm sure it's been done before. If you don't understand something, just ask.. I'll do my best to explain it.