mob
proc //eh, lets make it a proc.
gold_check(obj/O) //defining an obj, as thats what you'd buy
if(usr.gold <= O.value) //this i have a question about. it's SUPPOSED to be (in english) "if your gold is LESS then the object's value, i wont let you buy it", its to prevent negative gold.
alert("Uhm, you dont have enough money for this...") //haha, keep trying~!
return //it may not be needed, but can it hurt?
for something?
That's saying if it's less than or equal. Since you prolly want to allow players to buy something if they have exactly enough money for it, you'll probably want to change it to this: