ID:141894
 
Code:
obj
Time_Bomb
name = "Time bomb"
icon = 'bomb.dmi'//dont have a base icon so cant make icon!lol
icon_state = "time"
verb
set_bomb()
set src in oview(1)
if(usr.fired == 0)
view()<<"Time bomb has been planted"
sleep(10)
usr<<"Bomb will explode in 5"
sleep(10)
usr<<"Bomb will explode in 4"
sleep(10)
usr<<"Bomb will explode in 3"
sleep(10)
usr<<"Bomb will explode in 2"
sleep(10)
usr<<"Bomb will explode in 1"
sleep(10)
usr<<"*click*"
Explode(new /Effect/BasicBoom(src.loc,1,2))
for(var/mob/M in view(src,2))
M.hp -= 100
usr.deathcheck(M)
del(src)
del(src)
pick_up()
set src in oview(1)
src.loc = usr
drop()
src.loc = usr.loc


Problem description:
I played around with this but cant really spot why this time bomb only hurts one mob in its range and not all mobs. and it does not dissapear after exploding. -.-

flame me not pl0x
1) Look up Boolean variables

2) You're deleting the bomb after you damage 1 person, not after you damage them all.
In response to Andre-g1
But since i did for(M in view(src,2)) shouldnt it delete all the mobs in the bombs radius?
In response to Gogeta126
Take out the del(src) inside the for() loop. You hurt one mob and then it deletes itself before it goes to the next mob.
In response to Bakasensei
yes i already noticed that thx. it would delete right after killing one mob. but it still only kills one person even after temporarily removing both "del"s
In response to Gogeta126
still need halp
In response to Bakasensei
still failed
In response to Gogeta126
It might be usefull if you post the "edited" code as well, so people know what you tried to fix the problem.

Asides, I think (edit:) that I'm wrong and need eyeglasses, thanks Kaioken ;)
In response to Schnitzelnagler
In the case of those specific procs (and you could also make your own custom procs like this if you wanted, of course) like view(), range() series and as such, they support the reverse order as well. From that same Reference entry: Both arguments are optional and may be passed in any order.