Hello guys, my problem is that by killing an NPC I get this error.
Code:
runtime error: Cannot create objects of type null.
proc name: dropea (/mob/proc/dropea)
source file: 1.6 Procs 3.dm,724
usr: (src)
src: Jety4 (/mob)
src.loc: NaruterosV3 (332,239,1) (/turf/HIerba/dgrass)
call stack:
Jety4 (/mob): dropea(Nidaime (/mob/enemy/Nidaime))
Nidaime (/mob/enemy/Nidaime): Death(Jety4 (/mob))
Jety4 (/mob): ataproc()
Jety4 (/mob): Atacar()
Code:
mob/proc/dropea(mob/M)
var/ropa=""
var/rand1=rand(1,17)
if(rand1==1) ropa="Kankuorusuit"
if(rand1==2) ropa="Shinigamitraje"
if(rand1==3) ropa="trajedemadara"
if(rand1==4) ropa="Zabuzasuit"
if(rand1==5) ropa="Scroll_Doton1"
if(rand1==6) ropa="Scroll_Fuuton1"
if(rand1==7) ropa="Kankuorusuit"
if(rand1==8) ropa="Shinigamitraje"
if(rand1==9) ropa="trajedemadara"
if(rand1==10) ropa="Zabuzasuit"
if(rand1==11) ropa="Scroll_Rai1"
if(rand1==12) ropa="Scroll_Katon1"
if(rand1==13) ropa="RockLeesuit"
if(rand1==14) ropa="Narutosuit"
if(rand1==15) ropa="Neijisuit"
if(rand1==16) ropa="Windmill"
if(rand1==17) ropa="Trikunai"
var/obj/O = "/obj/ropas/tienda/[ropa]"
O=new O//this is the line 724 of code
O.loc = M.loc
O.xco = O.x;O.yco = O.y;O.zco = O.z//nuevo
spawn(600)//nuevo
if(O&&O.loc==locate(O.xco,O.yco,O.zco))del O//nuevo