Here, this may help (I took the idea from AUM 59 for you)
Code:
var TraceCoords;

on_mouse_left=TeleportGun();

function TeleportGun()
{
vec_set(TraceCoords.x, vector(10000, 0, 0)); //shoots 10000 quants
vec_rotate(TraceCoords.x, player.pan); //shoots in the direction of the player
c_trace(player.x, TraceCoords.x, ignore_me | ignore_passable | activate_shoot);
if (you.skilln==9)
{
...put teleport stuff here
}
}



Now that is the general idea, and I *think* it may work but I didn't test it because I just don't have time (and obviously there is no teleport code there )

Good luck.