ID:268130
 
Im trying to make a code That when u click on turfs,Obj or Mobs In sight You get tleported to them BUT you leave an after image Of your self for a split seconde How would i do that?



Thanks In advance
show us what you tried and we might be able to help more
here's the code for click to an teleport and ur there lol here:





world
mob = /mob/PC
name = "Multi Click Demo"

mob
PC
icon = 'PC.dmi'
Login()
src.loc = locate(1,1,1)
alert("Click On The Tree, Bob, And The Teleporter")
bob
density = 1
icon = 'bob.dmi'
Click()//Define The Click Inside What Your Using It For, Not With Cleint.click
usr<<"That Tickels"//When You Click bob, The Person That Clicked Him Gets The Message "That Tickels"
obj
teleporter
icon = 'tele.dmi'
Click()//We'll Use This One As A Click Teleporter
usr<<"You Teleport Back To Start"
usr.loc = locate(1,1,1)//When They Click It, It Takes Them Back To Start
turf
tree
icon = 'tree.dmi'
Click()//same here, if you define click inside the atom instead of inside the client, you can use it multiple times!
usr<<"Some Apples Fall Down"
grass
icon = 'grass.dmi'
Click()
usr<<"Yes, It's Grass,"


just add the turfs and no error's
In response to Goddz
Goddz wrote:
here's the code for click to an teleport and ur there lol here:





world
mob = /mob/PC
name = "Multi Click Demo"

mob
PC
icon = 'PC.dmi'
Login()
src.loc = locate(1,1,1)
alert("Click On The Tree, Bob, And The Teleporter")
bob
density = 1
icon = 'bob.dmi'
Click()//Define The Click Inside What Your Using It For, Not With Cleint.click
usr<<"That Tickels"//When You Click bob, The Person That Clicked Him Gets The Message "That Tickels"
obj
teleporter
icon = 'tele.dmi'
Click()//We'll Use This One As A Click Teleporter
usr<<"You Teleport Back To Start"
usr.loc = locate(1,1,1)//When They Click It, It Takes Them Back To Start
turf
tree
icon = 'tree.dmi'
Click()//same here, if you define click inside the atom instead of inside the client, you can use it multiple times!
usr<<"Some Apples Fall Down"
grass
icon = 'grass.dmi'
Click()
usr<<"Yes, It's Grass,"


just add the turfs and no error's

1. Use DM tags.
2. Tell them the link to Demo instead of claiming it as your own.

--SSJ4_Gohan_Majin
In response to Goddz
WTF no What ever they Double click on The teleport to it i figured out the restbut i need now with click teleport If i DB click Example a bush,sign,tree,or mob i would go to it
In response to Dranzer_Solo
Dranzer_Solo wrote:
WTF no What ever they Double click on The teleport to it i figured out the restbut i need now with click teleport If i DB click Example a bush,sign,tree,or mob i would go to it

All you need to do is code the object, and write the DblClick() proc.
obj
Bush
icon = 'bush.dmi'
DblClick()
src.loc = locate(2,2,2)//location of bush here
src <<"You teleported to the coordinates: [src.x], [src.y], [src.z]"



--SSJ4_Gohan_Majin
In response to N1ghtW1ng
hey guys I think he means Double Click when he says DB Click. Is that what you mean?
In response to SSJ4_Gohan_Majin
Except when you click on an obj the src is the object. You would have to use usr in this case.
In response to Jotdaniel
Thanks All I think Figured IT All Out That After IMage was kinda hard
In response to Dranzer_Solo
WTF NO NO NO NO i dobnt want if i clik on Thses special objects to take me to spawn points i want if i see grasss or a tiel or a tree In the middle of the screen and i click it i go their I dont want to have to set eachand every loc for each obj
What you need to do is override the DblClick() procedure for whatever you want to be able to teleport to.
For example:
obj
DblClick()
if(src.x) // Quick way of checking if the obj is in the world
usr.loc = src.loc // Set the person who clicked's location to src's location


With turfs, it's slightly different, because turfs are located inside areas. In that case, just set usr's location to the turf(src) itself.

To leave an "afterimage" of yourself, before actually relocating usr, create a dummy mob where he used to be, and either sleep() in the dummy mob's new code before having it delete itself, or spawn() out code in the DblClick that deletes the dummy mob.
In response to Jon88
thanks!
In response to Jon88
the turf and mob part do i just change the (Src,x) to ....