Post: Help with Teleport function
12-22-2016, 09:34 PM #1
Zakira
Haxor!
(adsbygoogle = window.adsbygoogle || []).push({}); So I'm trying to implement some basic teleport function (like teleporting someone to a certain place in the map). How do you figure out the coordinate points for the certain place you are trying to teleport? In other words, how do you get the* numbers for the location you are trying to teleport to?
(adsbygoogle = window.adsbygoogle || []).push({});
12-23-2016, 12:29 AM #2
anthonything
Space Ninja
Originally posted by Zakira View Post
So I'm trying to implement some basic teleport function (like teleporting someone to a certain place in the map). How do you figure out the coordinate points for the certain place you are trying to teleport? In other words, how do you get the* numbers for the location you are trying to teleport to?


You have to write a script to run through and get the coordinates yourself. A cleaner method is to get a script entity that you know of and use relative coordinates but that is a bit more complex and not necessary.
Just write a bullettrace and an iprintln of the trace["position"]
12-23-2016, 08:28 AM #3
Zakira
Haxor!
Originally posted by anthonything View Post
You have to write a script to run through and get the coordinates yourself. A cleaner method is to get a script entity that you know of and use relative coordinates but that is a bit more complex and not necessary.
Just write a bullettrace and an iprintln of the trace["position"]


I am not familiar with the bullettrace function. Do you mind explaining what parameters the bullettrace takes, and how I can use it with the iprintln?
12-23-2016, 07:07 PM #4
anthonything
Space Ninja
Originally posted by Zakira View Post
I am not familiar with the bullettrace function. Do you mind explaining what parameters the bullettrace takes, and how I can use it with the iprintln?


GetNormalTrace()
{
return bullettrace(self gettagorigin("j_head"), self gettagorigin("j_head") + anglesToForward(self getplayerangles()) * 1000000, 0, self);
}

self iprintln(self GetNormalTrace()["position"];

Then loop it for when you shoot

The following user thanked anthonything for this useful post:

Zakira
12-23-2016, 09:48 PM #5
Zakira
Haxor!
Originally posted by anthonything View Post
GetNormalTrace()
{
return bullettrace(self gettagorigin("j_head"), self gettagorigin("j_head") + anglesToForward(self getplayerangles()) * 1000000, 0, self);
}

self iprintln(self GetNormalTrace()["position"];

Then loop it for when you shoot


So once I put this in a loop that calls the shoot function, what exactly does this print? Does this print the current location of my player? or will it print the location of where my bullet is pointed to?
12-23-2016, 10:08 PM #6
anthonything
Space Ninja
Originally posted by Zakira View Post
So once I put this in a loop that calls the shoot function, what exactly does this print? Does this print the current location of my player? or will it print the location of where my bullet is pointed to?


Where your bullet hits the ground. You can also print self.origin if you want the player's stationary origin
01-17-2017, 03:32 PM #7
matrixmods
Pokemon Trainer
Originally posted by anthonything View Post
GetNormalTrace()
{
return bullettrace(self gettagorigin("j_head"), self gettagorigin("j_head") + anglesToForward(self getplayerangles()) * 1000000, 0, self);
}

self iprintln(self GetNormalTrace()["position"];

Then loop it for when you shoot


this is rather complicated for getting location coordinates. just create a loop and print self.origin. Then you can use noclip and fly to wherever and itll still give you the coords

The following user groaned matrixmods for this awful post:

anthonything
01-18-2017, 10:12 AM #8
Kronos
Former Staff
Originally posted by Zakira View Post
So I'm trying to implement some basic teleport function (like teleporting someone to a certain place in the map). How do you figure out the coordinate points for the certain place you are trying to teleport? In other words, how do you get the* numbers for the location you are trying to teleport to?


Question Seems Answered. Thread Closed.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo