ID:143782
 
Code:
mob
Skelleton
name = "Weak Skelleton"
icon = 'Enemys.dmi'
icon_state = "skelleton"
Health = 9999
Strength = 300
var/mob/m
New()
. = ..()
spawn()
CreateName()
Wander()
proc/Wander()
while(src)
sleep(5)
for(var/mob/M in oview(8))
if(M.client)
step_towards(src,M)
src.dir=get_dir(src,M)
src.Fight()

Bump(mob/m)
if(istype(m,/mob/))
if(m.player == 1)
Fight(m)
else
return
proc/Fight(mob/m)
if(m.client)
var/damage = src.Strength
m.Health -= damage
m << "[src] attacks you for [damage] damage!!"
src<<"You attack [m] for [damage] damage!!"
m.death_check(src,m)


...........................................................

I got that now but how do i make it so it doesnt attack trees ?? because when it bumps into trees i get an error/.


(/turf/tree/tree6))
runtime error: Cannot read null.client
proc name: Fight (/mob/Skelleton/proc/Fight)
source file: Enemys.dm,33
usr: Weak Skelleton (/mob/Skelleton)
src: Weak Skelleton (/mob/Skelleton)
call stack:
Weak Skelleton (/mob/Skelleton): Fight(null)
Weak Skelleton (/mob/Skelleton): Wander()
Weak Skelleton (/mob/Skelleton): New(the grass (54,2,2)



Looks like its checking if a turf has a client.
try changing
if(istype(m,/mob/))
to
if(ismob(m))

if it still persists try adding in a check within the Fight proc and maybe instead of
proc/Fight(mob/m)
you have
proc/Fight(var/mob/m)
(just looks neater to me XD)
In response to Lyndonarmitage1
mob
Skelleton
name = "Weak Skelleton"
icon = 'Enemys.dmi'
icon_state = "skelleton"
Health = 9999
Strength = 300
var/mob/m
New()
. = ..()
spawn()
CreateName()
Wander()
proc/Wander()
while(src)
sleep(5)
for(var/mob/M in oview(8))
if(M.client)
step_towards(src,M)
src.dir=get_dir(src,M)
src.Fight()

Bump(mob/m)
if(ismob(m))
if(m.player == 1)
Fight(m)
else
return
proc/Fight(var/mob/m)
var/damage = src.Strength
m.Health -= damage
m << "[src] attacks you for [damage] damage!!"
src<<"You attack [m] for [damage] damage!!"
m.death_check(src,m)

...........................................................

its still persisting to hurt the turfs damnit >_<
My suggestion would be to remove the two src.dir= and the src.Fight() lines from the Wander() proc. Then, change oview(8) to oview(src,8).