mob/amonster/proc/AI()
var/mob/M
while(src)
if(M.client)
if(M in oview(5))
walk_to(src,M,1,4) //src walks to M until it is within 1 block away, moving 4/10th of a second
if(M in oview(1))
step_towards(src,M)
else
break
else
for(M in view(src))
break
//sleep 2 ticks between moves
sleep(2)
spawn(20)
AI()
Problem description:
runtime error: Cannot read null.client
proc name: AI (/mob/amonster/proc/AI)
usr: CircleDemon (/mob/amonster/CircleDemon)
src: CircleDemon (/mob/amonster/CircleDemon)
call stack:
CircleDemon (/mob/amonster/CircleDemon): AI()
CircleDemon (/mob/amonster/CircleDemon): New(the turf (4,11,1) (/turf))
for some reason when ever i start the game that error pops up and no npc will attack
The obvious design flaws in your program aside the error is simple. By the time you're checking for M.client, M is null as it hasn't been assigned any value, thus the problem.