ID:142934
 
Code:
area/nokill
Entered(mob/M)
M.canattack=0
Exited(mob/M)
M.canattack=1


Problem description:
So this is in the spawn point, but it doesn't seem to work. Did I screw it up somewhere?
Are you doing a check for canattack in your attack procedure? Make sure you do that or it's just a pointless variable.
Entered() and Exited() are never called if you modify loc directly. Instead of what you have, do this:

area
var/pacify = 0

mob/proc/attack(var/mob/M)
//get the area we're standing in (or what should be an area)
var/area/A = loc.loc
//if the area is pacified (or loc.loc isn't an area, meaning we're in the contents of something else), return
if(!isarea(A) || A.pacify)
return
//attack stuff here
In response to Jholder84
Yeah. if usr.cannattack==0 then the user can't attack.
In response to Garthor
Okay, so I added that in, but how do I get the area from the code to the map, since it doesn't have a name?

I tried:

area
nokilling
var/pacify=0


But it didn't work. I had an error.
In response to GohanIdz
So at the beginning of your attack proc you have
Attack()
if(usr.canattack==0)
usr << "You can't attack"
return
the
rest
of
your
code

Is that basically right?

:EDIT:

And let me further ask...
Do you want the mob to not be able to attack or do you want them to not be attackable?
In response to GohanIdz
The variable is already defined, so you'd just do pacify=0, not var/pacify=0.

And it would be 1 to prevent killing, not 0.
In response to Jholder84
I want them not to be able to attack.

I put in the pacify bit though, so I guess we'll see if that works.