ID:263665
 
I am trying to get Instant Transmision (IT) to transport people next to you if you tell it to but i cant seem to get it, here is the code please help.


mob/learn
verb/Instant_Transmission()
set category = "Techniques"
var/ki_cost = rand(60,100)
if(src.doing)
src << "You are already doing something!"
return
if(src.grav)
src << "<font color=#FF9900><b>Training Information:</font> \white You cannot IT whilst gravity training!"
return

if(src.buku)
return

if(src.grav_on)
return

if(src.dead)
return

if(src.stone_form)
return

if(src.donut_wrapped)
return

if(src.grav_popup)
return

if(src.grav_delay)
return

if(src.regen_dead)
return

if(src.KO)
return

if(src.it_lock)
src << "Cannot use this Technique at his time"
return

if(src.ki_lock)
src << "Cannot use this Technique at his time"
return

if(src.in_guild)
switch(alert("EC Or Guild Member?","Instant Transmission","EC","Guild Member"))
if("Guild Member")
usr.Guild_IT()
if("EC")
if(src.ki > ki_cost)
var/code = input("Which Energy Code do you wish to IT to?")as num
if(lentext(code) > 7)
src << "EC too Long!"
return
if(code == src.energy_code)
src << "Thats your EC!"
return
if(!code)
return
else
if(src.dead)
alert("Tehir Ki is no longer of the living...")
return
else
for(var/mob/M in world)
if(M.energy_code == code)
if(!M.it_blocked)
src.ki -= ki_cost
src << "<B>Locking onto [M]..."
sleep(15)
src<<"LOCKED!"
src << "<B>[M] Found!"
src.icon_state = "IT"
sleep(6)
usr.icon_state = ""
if(!usr)return
if(!M)return
src.x = M:x
src.y = M:y-1
src.z = M:z
view(6) << "<B>[usr] appears from nowhere!"
src.icon_state = "IT"
sleep(6)
src.icon_state = ""
src.afk_time = 0
else
src << "You cannot seem to get a clear lock on [M]'s energy signal..."
return
else
src << "You do not have enough Ki!"
return
else


if(src.ki > ki_cost)
var/code = input("Which Energy Code do you wish to IT to?")as num
if(lentext(code) > 7)
src << "EC too Long!"
return
if(code == src.energy_code)
src << "Thats your EC!"
return
if(!code)
return
else
if(src.dead)
return
else
for(var/mob/M in world)
if(M.energy_code == code)
if(!M.it_blocked)
src.ki -= ki_cost
src << "<B>Locking onto [M]..."
sleep(15)
src << "<B>[M] Found!"
src.icon_state = "IT"
sleep(6)
usr.icon_state = ""
if(!usr)return
if(!M)return
src.x = M:x
src.y = M:y-1
src.z = M:z
view(6) << "<B>[usr] appears from nowhere!"
src.icon_state = "IT"
sleep(6)
src.icon_state = ""
src.afk_time = 0
else
src << "You cannot seem to get a clear lock on [M]'s energy signal..."
return
else
src << "You do not have enough Ki!"
return



Please anyone with ideas help
So what's not working?
In response to Dession
It works fine, but i need to find a way to have it also teleport people right next to you, and i cant seem
In response to Lt. Pain
usr.Move(locate(src.x+1,src.y,src.z)), this will teleport your character next to src
In response to Furrie
Yes i know, the code works fine, i need a way for it to take the person standing right beside you with you just like in DBZ, when people next to Goku got teleported with him
In response to Lt. Pain
for(var/mob/player/P in oview(1))