ID:140258
 
Code:
obj
teleporter
icon = 'teleporter.dmi'
icon_state = "tele"
var/coords = 0
density = 1 // also tryed 0 and entered().
Enter(mob/M)
if(coords == 2)
M.loc = locate(2,5,1)
return
if(coords == 1)
M.loc = locate(10,15,1)
return
else
return

verb
Set_Coords()
set src in oview(1)
var/A = input("type in a coordinate!") as num
src.coords = A

mob
icon = 'mob.dmi'
density = 1


Problem description:
Well nothing happens, nothing at all. it might be me overlooking something, who knows. help please.
First of all, your logic error is within the misunderstanding of atom.Enter().
If you read up on the reference entry, you'll realize that 'walking on a turf' is different from 'walking on a turf that contains an object'.
The next point to note is that Enter should never actually do anything other than decide if the atom can be moved to or not.
Everything else, for example an action as mentioned here, should be handled within atom.Entered(), or you can severely screw up your built in movement system (path-finding wise).
atom.density would actually influence the default Enter of the object containing your teleporter, so Enter would not even be called.
As for deciding on where to teleport, datum.tag is the way to go, if you're looking for ease of use and modularity.

Garthor actually has a neat little posting on this:[link]
turf/teleporter
var/destination
Entered(atom/movable/A)
if(destination) //if we have a destination set
var/turf/T = locate(destination)
if(T) //and we can find that destination
A.loc = T //set loc to the located destination turf
//(direct alteration of loc used to bypass any possibility of movement failure)


Place an instance of turf/teleporter on the map. Edit (by right-clicking on it and selecting edit) its destination to some unique text string. Go to the turf you want the destination to be, right-click it and edit its tag to be the same as the teleporter's destination.
In response to Schnitzelnagler
thx