ID:176456
 
My code is :

    proc
Kill(mob/M in oview(1))
if(istype(M,/mob/monsters))
view(6) << "[src] slices [M] with his sword!"
del(M)
Kill()
else
..()
Kill()
New()
Kill()


And for some reason it doesnt kill the monster in oview 1...Thanks in advance for helping!

-Crio
Sorry if this bumps but i get the runtime errors:

runtime error: Maximum recursion level reached (perhaps there is an infinite loop)
To avoid this safety check, set world.loop_checks=0.
proc name: Kill (/mob/guards/Recruit_Guard/proc/Kill)
usr: Recruit Guard (/mob/guards/Recruit_Guard)
src: Recruit Guard (/mob/guards/Recruit_Guard)
call stack:
Recruit Guard (/mob/guards/Recruit_Guard): Kill(null)
Recruit Guard (/mob/guards/Recruit_Guard): Kill(null)
Recruit Guard (/mob/guards/Recruit_Guard): Kill(null)
Recruit Guard (/mob/guards/Recruit_Guard): Kill(null)
Recruit Guard (/mob/guards/Recruit_Guard): Kill(null)
Recruit Guard (/mob/guards/Recruit_Guard): Kill(null)
Recruit Guard (/mob/guards/Recruit_Guard): Kill(null)
Recruit Guard (/mob/guards/Recruit_Guard): Kill(null)
Recruit Guard (/mob/guards/Recruit_Guard): Kill(null)
Recruit Guard (/mob/guards/Recruit_Guard): Kill(null)
...
Recruit Guard (/mob/guards/Recruit_Guard): Kill(null)
Recruit Guard (/mob/guards/Recruit_Guard): Kill(null)
Recruit Guard (/mob/guards/Recruit_Guard): Kill(null)
Recruit Guard (/mob/guards/Recruit_Guard): Kill(null)
Recruit Guard (/mob/guards/Recruit_Guard): Kill(null)
Recruit Guard (/mob/guards/Recruit_Guard): Kill(null)
Recruit Guard (/mob/guards/Recruit_Guard): Kill(null)
Recruit Guard (/mob/guards/Recruit_Guard): Kill(null)
Recruit Guard (/mob/guards/Recruit_Guard): New(the grass (38,29,1) (/turf/grass))

When i login...
In response to Koolguy900095
New Guard created, looking for mobs in oview(usr,1).
None found. Calling Kill() again, waiting for return value.
New Guard created, looking for mobs in oview(usr,1).
None found. Calling Kill() again, waiting for return value.
New Guard created, looking for mobs in oview(usr,1).
None found. Calling Kill() again, waiting for return value.
New Guard created, looking for mobs in oview(usr,1).
None found. Calling Kill() again, waiting for return value.
New Guard created, looking for mobs in oview(usr,1).
None found. Calling Kill() again, waiting for return value.
...
Maximum recursion level reached (ie, too many procs are waiting for another proc to stop).
...

You need to spawn() in new procs, so that the original proc acn return.
In response to Garthor
so i add:

spawn()
Kill()?


If so the guard still wont kill my monsters if they walk by...
In response to Koolguy900095
Oh and if i just put spawn() i get ATON of lag i can barely move...but if i put spawn(1) i get no lag...its weird
In response to Koolguy900095
That's because you're calling Kill(), but Kill() takes an argument, which is a mob in oview(usr,1). Instead:
mob/Guard/proc/Kill()
var/mob/M = locate() in oview(src,1)
if(M)
world << "M spontaniously combusts"
spawn(4) Kill()

mob/Guard/New()
spawn() Kill()
..()
In response to Koolguy900095
Well what do you expect when you're repeating something precisely as fast as your computer can handle?