ID:143643
 
Code:
mob
Spider
name = "Spider"
icon = 'Monsters.dmi'
icon_state = "spider"
HP = 30 //this defines "Killers" health
MAXHP = 30
DMG = 1
MDMG = 5
Player = 0
EXP = 5
GOLD1 = 0
GOLD2 = 3
Respawn = 1000
var/mob/PC
New()
. = ..()
spawn()
Wander()
proc/Wander()
while(src)
if(PC in oview(5))
step_towards(src,PC)
for(PC in oview(1))
break
for(PC in oview(2))
break
for(PC in oview(3))
break
for(PC in oview(4))
break
else
step_rand(src)
sleep(10)
for(PC in oview(5))
break
sleep(10)
spawn(10)
Wander()
Bump(mob/M in oview(1))
if(M.Player == 1)
Fight(M)
else
return

proc/Fight(mob/M)
var/damage = rand(DMG,MDMG)
M.HP -= damage
M << "[src] attacks you for [damage] damage!!"
Dcheck(M)


Problem description: It seems to be going fine until they bump into things that arent me.... I get this error.

runtime error: undefined variable /turf/obstacles/tree/var/Player
proc name: Bump (/mob/Spider/Bump)
usr: Spider (/mob/Spider)
src: Spider (/mob/Spider)
call stack:
Spider (/mob/Spider): Bump(Tree (91,89,3) (/turf/obstacles/tree))
Spider (/mob/Spider): Wander()
Spider (/mob/Spider): New(Ground (92,91,3) (/turf/grounds/treelow))

treelow isn't even dense.

Thanks in advance...

Next time use "Dm" tag's please....

-Genjura