ID:148290
 
what is a undefined ver? this is my code i got if off of a tutorial:

obj
gold
icon = 'gold.dmi'
var
amount
verb
get() //obj/gold/verb/get()
set src in view(1) //src must be close
usr << "You pick up [amount] gold."
***usr.wealth += amount //add to usr.wealth
del(src) //delete the gold



*** = error

why is it saying this, what wrong with my code?
I got this from a tutorial....
May be im puting the code in the wrong place.......
mob/var/wealth = 0
In response to Airjoe
is that with tabs and returns?
In response to Nave
You can just stick that anywhere outside of any other codes on the left of the screen I think, but you should put it with the rest of your mob/vars and have it look something like this:

mob
var
othervar1
othervar2
othervar3
wealth = 0

I'm not familiar with that tutorial so I couldn't tell you where the other vars are.
Use src.amount except of amount. It will get confused with 'usr'.

~~Dragon Lord~~
In response to Nave
yes it is. you can put that anywhere in your code as long as its NOT indented
In response to Unknown Person
In this case, usr and src will be the same thing, so using src instead won't make any difference. =P

Nave, your problem is that you haven't given mobs a wealth var. You might have given certain types of mobs a wealth var; but as usr is a /mob (as opposed to a /mob/whatever), it won't have it. You need to define the wealth var directly under /mob, like this:

<code>mob var wealth=0</code>