ID:160999
 
ummm... i need help on using a obj to get to a diffrent map ive tried everything but my icon will just walk right through the object and just when it walks through it will get stuck so im just asking is there another way i can do this
mob
var
cant_move

mob
Move()
if(cant_move) return
..()

obj
portal
var
dest_x = 1
dest_y = 1
dest_z = 1

proc/Warp(var/mob/M)
M.cant_move = 1
sleep(10)
if(!M) return
M.cant_move = 0
M.Move(locate(dest_x,dest_y,dest_z))


turf
Entered(atom/movable/Obj,atom/OldLoc)
.=..()
if(ismob(Obj))
var/obj/portal/P = locate() in src
if(P)
P.Warp(Obj)
In response to Jemai1 (#1)
You gave him a piece of code that you know doesn't work?
O.o it doesn't work no wonder but ive changed it around
In response to Kaiochao (#2)
Oh. Yea.. I forgot to change cant_move before moving.
The original code for moving was:
client
Move()
if(mob.cant_move) return
..()

but I changed it to:
mob
Move()
if(cant_move) return
..()


The order of these two lines:
M.cant_move = 0
M.Move(locate(dest_x,dest_y,dest_z))
didn't matter on the former code.

EDITED!
You're probably looking for a turf not an object...
turf
Teleporter
icon = 'icons.dmi'
Entered(mob/M)
..()
if(ismob(M)) M.loc = locate(x,y,z)

Next time try and be more clear on what you want.