ID:680726
 
(See the best response by A.T.H.K.)
Error:

loading Turfs.dme
Mobs.dm:24:error: gold: undefined var
Objects.dm:14:error: gold: undefined var
Mobs.dm:23:error: src.gold: undefined var



Mob code, where var 'gold' is declared.

mob
var
gold = 0

player
icon = 'Icons.dmi'
icon_state = "Player"


Object code, where the code for the obj gold is.

obj //gold
gold
icon = 'Icons.dmi'
icon_state = "Gold"
//When double clicked usr picks up gold.
DblClick()
usr.gold ++
usr << gold
src = (usr.loc)
usr << "You recieved some gold!"
del.gold
..()





Problem description: I can't figure out what I am doing wrong...I am new, so it is probably a noob mistake. Thanks for the help!

Best response
usr << gold

needs to be

usr << usr.gold

Hence the undefined var you haven't attached that query above to a mob :)

[edit] don't think you need del gold since you have moved it to the player.
mob
var
gold
player
icon = 'Icons.dmi'
icon_state = "Player"

obj
gold
icon = 'Icons.dmi'
icon_state = "Gold"
DblClick()
usr.gold ++ // more gold, yay!
usr << usr.gold // displays how much gold you have

src.loc = usr.loc // places the gold at your location

usr << "You recieved some gold!"
del src // deletes the gold