ID:139163
 
Code:
mob
Enemies

New()
last_x=src.x
last_y=src.y
last_z=src.z
src.Stepped=rand(0,2)
Wander()
..()
proc
Wander()
var/mob/Enemies/E=src
if(E.DEAD!=2)
usr<<"[E]"
usr<<"[src]"
if(src.Stepped==2)
step_to(src,locate(src.last_x,src.last_y,src.last_z),1)
spawn(5)
step_to(src,locate(src.last_x,src.last_y,src.last_z),1)
src.Stepped=0
else
step_rand(src)
src.Stepped++
spawn(25)
Wander()
else
spawn(400)
usr<<"[E]"
var/mob/Enemies/A = E
new A(locate(E.last_x,E.last_y,E.last_z))
spawn(10)
del(E)


Problem description:
runtime error: Cannot create objects of type /mob/Enemies/Bat.
proc name: Wander (/mob/Enemies/proc/Wander)
usr: Bat (/mob/Enemies/Bat)
src: Bat (/mob/Enemies/Bat)
call stack:
Bat (/mob/Enemies/Bat): Wander()

Just needing the code after 4mins to place another mob of the same type killed at the spawn point of the one that died and del the one that was dead. What am I doing wrong :/
You need to use a type path, not an object reference.

Get rid of the E and A variables, they're doing nothing, and hold the same value as src.

Then just do this to create a new mob of src's type:
new src.type(locate(src.last_x,src.last_y,src.last_z))
In response to DarkCampainger
Thanks, Dark... works perfect now :)