ID:147067
 
    Beg_For_Money()
var/mob/M
for(M in get_step(usr.dir,usr))
if(M.type == /mob/NPCs/F10/Person)
if(usr.gold >= 100)
usr << "Go away!"
else
var/randnum = rand(1,usr.gold)
randnum = 100-randnum
usr << "Fine. Here. have [randnum] gold."
usr.gold += randnum

//This code does not work. When I use it, it does not see ANY var/mob/M (meaning I get less gold from them as people on other games asking real people). I tried adding an "else" proc just to test the first if() statement; but it didn't give me anything. I even tried changing it to var/atom/M but that didn't work either...Here's a WORKING code for treasure chests...

Open()
var/obj/O
for(O in get_step(usr,usr.dir))
if(O.type == /obj/chest1)
if(usr.Key1 != 1)
usr << "You find the Blue Key"
usr.Key1 = 1
else
usr << "Empty..."

//Both verbs are under the parent /mob/verb/unlockables if that helps any; because you only have them on certain floors of the dungeon.
Cowdude wrote:
>   Beg_For_Money()
> var/mob/M
> for(M in get_step(usr.dir,usr))
> if(M.type == /mob/NPCs/F10/Person)
> if(usr.gold >= 100)
> usr << "Go away!"
> else
> var/randnum = rand(1,usr.gold)
> randnum = 100-randnum
> usr << "Fine. Here. have [randnum] gold."
> usr.gold += randnum

In 'for(M in get_step(usr.dir,usr))', you have the arguements to get_step around the wrong way.
Get_step(ref,dir) remember?
In response to Lazyboy
gah I would have never seen that oops =/