ID:148372
 
This is broken cause when u touch it it wont teleport u to the place.
turf/portal
icon = 'portal.dmi'
portal2
Enter()
usr.Move(locate(18,14,2))

and im tryin to make it so only the chars could go through and not the monsters.
Lots of problems here.

First: Use Entered(atom/movable/A) . That is called when an atom/movable enters the turf. Enter() is called to check if an atom/movable can enter the turf or not, and returns 1 if it can 0 if it can't.

Second: usr is not appropriate in any proc. It is even less appropriate in Enter(), Exit(), Entered(), Exited() and Move(). This is how it should be done:
turf
portal
icon = 'portal.dmi'
var/dest = ""
Entered(atom/movable/A)
if(ismob(A))
var/mob/M = A
if(M.client)
M.Move(locate(dest))
portal2
dest = "portal2exit"

Then, in the map editor, right click on any turf, edit it's properties, and set it's tag to "portal2exit". This will then teleport the mob to that turf.
In response to Garthor
so the monsters cant go thrtough it?
In response to BlazingDragoon
The if(M.client) handles that. mobs that don't have clients aren't players.
In response to Garthor
can u edit this so monster cant go through it cuz the 1 u put had too many errors

turf/Teleport
{
Entered(mob/M)
{
. = ..()
if(ismob(M))
M.loc = locate(49,49,3)
}
}
In response to BlazingDragoon
You should post the errors you are getting. also you may want to take a look at my.

also the way you used { and } is rather pointless.

if you had done

turf/Teleport
Entered(mob/M)
. = ..()
if(M.client)//if M is a client
M.loc = locate(49,49,3)

Also, The way garthor posted the locate method using a tag rather than an xyz location is better. (I learned this the hard way when I decided to expand the map of my game downward and leftward, I just made the entire map larger and then moved everyting to the center, making what was 20,20,1 120,120,1 which caused all the teleports to screw up. Where as if I had used tags it would have moved the tags with the map when i moved it.)