ID:162167
 
Ok this is probably something really simple but I'm still a new coder so can someone please help....

I'm trying to make a verb that when activated, wherever you click on the screen you mob will move there.....not like a walk across the screen to that point....like an instant movement to that location.......to put it into perspective closest thing is like a flash step from bleach games that is controlled by clicking on the screen

If you can help I'd appreciate it. Thanks!
mob
var
cantele = 0

verb
activate()
if(!cantele)
src.cantele = 1
src <<"You can teleport now!"
else
src.cantele = 0
src <<"You can't teleport!"

turf
Click()
if(usr.cantele)
usr.loc = src
else
usr <<"You must turn teleporting on!"


However, if you only want the player to be able to teleport once, then have to reactivate the teleport ability, use this:

    verb
activate()
if(!cantele)
src.cantele = 1
usr <<"You can teleport now!"

turf
Click()
if(usr.cantele)
usr.loc = src
usr.cantele = 0
else
usr <<"You must turn teleporting on!"


And if you want them to be able to teleport without toggling on, and force them to wait in between teleports, then:

mob
var
cantele = 1

turf
Click()
if(usr.cantele)
usr.loc = src
usr.cantele = 0
sleep(30)
usr.cantele = 1
else
usr <<"You just telported! Please wait before trying again!"
hmmm

turf/DblClick(A)/src.loc = A:loc


remplace the '/' for DM Tags
In response to Siientxx
ok thx to everyone i got it to work now
In response to Pirata Inmortal
Uh, no. That would generate multiple errors. First of all, src is a turf, so you can't change its loc variable. Second, A is not always an atom, and so trying to treat it like one is ALSO going to lead to an error. What would be proper is:

turf
DblClick()
usr.Move(src)
In response to Garthor
my bad =(