ID:149836
 
Ok i have ben using this.

mob/M as mob in oview(1)

and now i need to make it where it selects all the mobs in a radious of what you put around you.

Something like this

for (var/mob/X in range(M,2))

exept for all of the mobs in that radious.

PS. It is for a self destruct verb.hehehe.

Please help me.
Use for().
mob
verb
Self_Destruct()
for(mob/M in mob in oview(2))
M.hp = 0
M:deathcheck()


-Rcet
In response to Rcet
That doesn't work.

mob/verb
SelfDestruct(mob/M in mob in oview(1))


Thats what i put and it won't work.

I tried making it this to

mob/verb
SelfDestruct(
for(mob/M in mob in oview(1))
In response to Freeker
I have tried that and i have tried alot of other things........ its agravating.. can you help me?
In response to Freeker
It was just a typo, it should have been like this:

mob
verb
Self_Destruct()
for(mob/M as mob in oview(2)) //changed "in mob" to "as mob"
M.hp = 0
M:deathcheck()
In response to English
I know that but.

I need a code that effects all mobs within that area.
In response to Freeker
mob/verb
SelfDestruct(mob/M in mob in oview(1))

That will target one mob in oview(1)

Use the for() loop inside the verb, not as a parameter like this:

mob/verb
SelfDestruct()
for(var/mob/M as mob in oview(2))
M.stuff = something

You can't put loops and complicated statements like if(), while(), and for() inside the parenthasis of the verb as a parameter.
In response to English
Ok. It think there has ben some miss understanding.
I am pretty much a Early intermediate BYOND programer.

I know what mob/M as mob in oview(whatever you wan) does.

I do not need that. What I am trying to do is make it where you do not choose a mob in the oview of yourslef that you put. I want it to effect all the mobs in the oview that you put.
In response to Freeker
He gave you a code that would do that...

The one that goes something like this:
verb
Self_Destruct()
for(mob/M in oview(2))
M.stuff = something //your damage code goes here


And to make it so that it affects all mobs in a radius that you choose...just change it like the following...

verb
Self_Destruct(radius as num)
for(mob/M in oview([radius]))
//your damage code goes here


That will prompt the user for a number when they use the verb... That number will then be passed through the variable [radius] into the oview() range limit...
In response to Freeker
I know what mob/M as mob in oview(whatever you wan) does.

Well, you posted this:

That doesn't work.

mob/verb
SelfDestruct(mob/M in mob in oview(1))


Thats what i put and it won't work.

You said it didn't work, then I told you why it didn't work yet you claim you know what it does. If you knew what it did then you would have known why it didn't work.

As SuperSaiyanGoku said, the code I gave you was EXACTLY what you asked for. His version is a little more comprehensive though, so I hope it helps.
In response to SuperSaiyanGokuX
Thanks alot man.