ID:143784
 
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)
var/Found = FALSE
for(var/mob/m in oview(8))
step_towards(src,m)
Found = TRUE
break
if(Found != TRUE)
sleep(10)
sleep(5)
Bump(mob/m)
if(istype(m,/mob/))
if(m.player == 1)
Fight(m)
else
return
proc/Fight(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)


Problem description:

How do i stop these things going to attack each other ???
You could try a variable given to players, I don't know if that's what you did with the "Player==1"..

When you create a variable, be sure to do (Mob Variable-->) mob/var/variablenamehere=0 if you don't want every mob to have the variable flicked "on".

I'll make up something without the variable you could also use, "client".
In response to Nightmare3
Not efficient.

Check if there is a client for the mob.
In response to Shlaklava
proc
findmob()
while(src)
var/found1=0
sleep src.waittime
for(var/mob/M in oview(src.farview))
if(M.client)
found1=1
step_towards(src,M)
if(M in oview(src,1))
src.dir=get_dir(src,M)
src.attack()
if(!found1)
step_rand(src)
In response to Nightmare3
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)