ID:262620
 
Code:
Give_Gold(M as mob in world)
var/a = input("How much gold do you want to give [M]","Give Gold",null)as num
if (Gold < a)
alert("You dont have that much gold")
return
else
src.Gold -= a
M.Gold += a


Problem description:loading Arena.dme
loading Arena.dms
Arena.dm:573:error:M.Gold:undefined var

Arena.dmb - 1 error, 0 warnings (double-click on an error to jump to it)
and gold is defined idk if im not useing M. right or something plese help
thanks in advance


The problem is that in your arguments, you never define what type of object M would be. In this case, I assume you'd want it to be a mob.

Give_Gold(mob/M as mob in world)


~~> Dragon Lord
In response to Unknown Person
k tnaks i didnt know thats how u had to use the mob in world thing
It'd be better to define a player type so NPCs and enemies and the like won't appear in the list.
Give_Gold(mob/players/M in world)