ID:174968
 
I've been trying to get this to work, but it's just not working right. When I use this verb, everyone in the world gets the money. Infact, it doesn't even let me choose a mob in world o_O. Such an easy piece of code, yet i'm stumped >_<

    Grant_Money(n as num)
set category = "Admin"
for(var/mob/M in world)
M.money += n


What am I doing wrong?


-Camaro-
Camaro wrote:
I've been trying to get this to work, but it's just not working right. When I use this verb, everyone in the world gets the money. Infact, it doesn't even let me choose a mob in world o_O. Such an easy piece of code, yet i'm stumped >_<
    Grant_Money(n as num)
set category = "Admin"
for(var/mob/M in world)
M.money += n
What am I doing wrong?

You're making a bad assumption: That looping through all mobs in the world will give you a choice as to which one you give money to. It won't.

If you say for(var/mob/M in world), DM will in fact loop through every mob in the world, just like you told it to.

Lummox JR
In response to Lummox JR
You're right... I feel stupid for starting this post ^_-

Grant_Money(mob/M in world, n as num)
set category = "Admin"
M.money += n

-Camaro-
In response to Camaro
*takes a picture* you know its not any time you see things this extremely stupid good job Camaro! :)