ID:154784
 
So it has been awhile since i have used DM, and I am trying to only allow mobs coming from the south to enter the area. All other directions will block the mob from entering.

A
Entered(mob/M)
if(M.dir<>NORTH)
return
..()
else
M.loc=locate(14,18,1)
It may be a bit too late in the night for me to be offering coding advice, but shouldn't that be == and not <>?

I've never seen <> so I don't really know what it does.
> A
> Enter(mob/M)
> if(M.dir == NORTH)
> return 1
>
> else
> M.loc=locate(14,18,1)
>


I Believe Enter() is what you should use, Entered() is for when they are entering it, not wether or not they can. When i think about it, this might cause some problems as well? haven't tested it so not sure.

what you could do if using entered() i guess is make them turn around and step out of the area again if they are entering for any other direction than south.
In response to Moonlight Memento
<> is just another way to place !! simple means not equal to. I am forcing the mob out of the area that is not facing north.
In response to Narutostory
Ahh that is why, thank you for the help. Like I said it has been awhile so i was checking the argument while the player has already entered the area, ant not to enter the area.
You shouldn't be using Entered() for this, but Enter(). Basically, rather than letting them enter the location and send them back, just prevent them from entering at all. You're doing it the backwards way.

[Edit]

I see the reply below mine has this same suggestion. Nonetheless, they are still doing it wrong. Enter() should only return a boolean value: Either true or false. If true is returned, then the mob attempting to enter is allowed to. Otherwise (i.e., if false is returned), they are not allowed to enter.