ID:179261
 
I have a problem where the monsters in my game step into turfs that are assigned to teleport the player to a different location..the bad thing is the monster also can go through, how would i fix this?

-NilFisk
Although this has been asked numerous times on the forum, I'll try to help you anyway. I would give all of the mobs that are actual players a certain var, then when they try to enter the town, it'll check for that special var, and if that mob has it, let them in, and if they dont'......don't.

mob
var
Human


turf
town
Entered(mob/M as mob)
if(M.Human >= 1)
M.loc = locate("Town")
else
return

Hope I helped.

?The Wizard of How¿

P.S Remember this is untested
In response to The Wizard of How
That code will work, but it's not efficent, here's another code that does the same thing:


turf/teleport
Enter(mob/M as mob)
if(!M.client)//if M has no client(NPC)
return..()
else//Has a client, is a player, can teleport
M.loc=locate(1,1,1)
In response to Nadrew
Thanks for that i was getting annoying with my monsters raiding the towns ^_^

-NilFisk