How do I make this no monster enter barrier thingy not delete the monsters? When a monster chases me and I run outside thr barrier, the monster vanishes when it runs into the barrier. How do i make it where the monster just stays inside of it instead of vanishing? Here is the code:
area
NoMonsterEnter1
Entered(mob/M)
if(M.client)
usr<<""
else
M.loc = locate(14,7,1)
ID:262092
![]() Aug 28 2004, 3:21 pm
|
|
![]() Aug 28 2004, 3:25 pm
|
|
Its not vanishing, its being teleported to co-ordinates(14,7,1)
If you want it to stay at its current location then after the else you could put a return command or do M.loc=M.loc |
SSJ2GohanDBGT wrote:
> area um, now they're chasing after me outside the barrier.... |
DeathAwaitsU wrote:
Its not vanishing, its being teleported to co-ordinates(15,17,1) um.same thing, didnt work |
What type paths are the mobs, and honestly that doesn't make sense. Also, I edited the post. Try Enter() instead of Entered(). I do believe Entered() happens after its done.
|
Ok, it does its job blockign. But its blocking me out too. Is there a way to block just the monsters and not me?
|
Thats because your the host, and you don't technically have a client(address, anyhow). Just add a check in it.
|
SSJ2GohanDBGT wrote:
area Two problems:
|
Heheh, oops. Thanks for catching my mistake. Care to explain why you need the ..() for players or mobs?
|
SSJ2GohanDBGT wrote:
Heheh, oops. Thanks for catching my mistake. Care to explain why you need the ..() for players or mobs? Because Enter() is expected to return a value. If you don't give it one, the return value is automatically null, which is interpreted as false: That is, allow no entry. Calling ..() and returning its value will send back the default value of Enter(), so for non-monsters this is the way to go. Without calling that, your code would always return null no matter what, so nothing could get in. Lummox JR |