ID:261244
 
on my game i have a problem with monsters walking into the towns.
game is like you walk out of town and you see the house. but monsters are getting in how can i make it so even if they step on the house they do not enter it?!?!?
var/turf/nomonster/Enter(mob/M)
if(istype(M,mob/monster/whatever))
return
DBGT Z wrote:
on my game i have a problem with monsters walking into the towns.
game is like you walk out of town and you see the house. but monsters are getting in how can i make it so even if they step on the house they do not enter it?!?!?

You set something up under the monster, if they hit that turf, then density = 1, that way it wouldn't allow anything to enter it. But if not setup under the monsters, like players, then density = 0 allowing them to pass through.

LJR
In response to Foomer
Foomer wrote:
var/turf/nomonster/Enter(mob/M)
if(istype(M,mob/monster/whatever))
return

Been a while? =)

turf/nomonster/Enter(mob/M)
if(istype(M,/mob/monster/whatever))
return 0
else
return ..()
In response to Foomer
Spuzzum i tried the code.
except my is


turf/nomonster/Enter(mob/M)
if(istype(M,/mob/evil/Dragon))
return 0
else
return ..()





didnt work the monsters still enterd the town.
In response to DBGT Z
DBGT Z wrote:
Spuzzum i tried the code.
except my is


turf/nomonster/Enter(mob/M)
if(istype(M,/mob/evil/Dragon))
return 0
else
return ..()





didnt work the monsters still enterd the town.


You have to set the icon to something, then place the turf on the map before this code will work.
In response to Spuzzum
im sorta new at this enter town thing sorta lik ehow DWO is.
so im comfused
if you have the time ONLY if you do.
can you explain step by step?
if you do thanks ^_^
In response to DBGT Z
Step by Step

1. Make a turf that uses the code that was given to you.

2. Place that turf on the town borders, this will prevent monsters from passing the borders.

Another way to do this.

turf/town_border
icon='something.dmi'
Enter(mob/M)
if(M.client == null)//This will check if M is a NPC
return 0
else
M.loc=locate(1,1,1)//change these to the coords you want M to warp to
In response to Nadrew
well it warps them away for sure, and when we " the people" step on it.
away we go to lol
how i fix that?
In response to DBGT Z
Are you using multiple maps? If you are use the code I gave you just change the 1,1,1 to the location you want them to go to.
If not use this code.

turf/no_monsters
icon='something.dmi'
Enter(mob/M)
if(M.client == null)
return 0
else
return..()
In response to Nadrew
that worked.
thanks for you're time.
In response to Spuzzum
isnt that a snippet from somewhere?
you snippet wizard you! ;)
In response to FIREking
FIREking wrote:
isnt that a snippet from somewhere?
you snippet wizard you! ;)

Uh, I was correcting Foomer's code. =|
In response to Spuzzum
i know you dont like me spuzzum, at least ive heard.
i was just being mean....ignore it =P

FIREking
In response to FIREking
FIREking wrote:
i know you dont like me spuzzum, at least ive heard.
i was just being mean....ignore it =P

Beg your pardon?

I don't dislike you. Never have. You annoy me at times, but I think you're on the level.
In response to Spuzzum
oh?
then i heard wrong!
i hate rumors, and im no longer going to pay attention to them.

sorry about the mis understanding spuzzum, i still respect you and look up to you, its just that i heard that you didnt like me from a certain someone.

FIREking