Page 1 of 1

About teleporting

Posted: Thu Jan 31, 2013 11:05 am
by kenzu38
Hey lisa, I am currently making a waypoint that will keybind all the hacks that I am using frequently.

One of them is teleport. I want the bot to teleport either forward, back, left or right (depending on the direction the char is facing) everytime I press a key.

You posted about your telefollow function in another thread, care to explain how I can use it to do what I want? It seems the function requires a target to follow. How about when there's no target? I just need the bot to teleport to a direction I like.

Please do explain how I can do that with your telefollow userfunction.

Thanks. :)

Re: About teleporting

Posted: Thu Jan 31, 2013 9:49 pm
by lisa

Code: Select all

	local function calccoords(dist,angle)
		if dist == nil or angle == nil then
			print("\nrequirements missing.\n")
			return
		end
		local degrees, theta, sn, cs, X, Z
		degrees = angle * 60
		theta=(degrees*math.pi)/180;
		sn=math.sin(theta);
		cs=math.cos(theta);
		X= (dist*cs)
		Z= (dist*sn)
		return X,Z
	end

Code: Select all

X,Z = calccoords(_dist,target.Direction)
that is from that userfunction, you just need to change target.Direction to player.Direction.
The next line

Code: Select all

teleport((target.X - X), (target.Z-Z), target.Y)
again change target. to player.
the way that is set up it will be directly behind X-X, Z-Z
if you want to go forward then obviously X+X,Z+Z

Hopefully you can work out the rest for yourself ;)

Re: About teleporting

Posted: Thu Jan 31, 2013 11:15 pm
by kenzu38
I see. Ok, thanks a lot for that explanation! :D
lisa wrote:Hopefully you can work out the rest for yourself ;)
I sure hope so haha.

Anyway, can't wait to test this. Will just post here if I encounter any problem.

Again, thanks a lot lisa!

Re: About teleporting

Posted: Fri Feb 01, 2013 11:19 am
by kenzu38
Hoho, it works! I'm having fun teleporting around atm haha.

Thanks for the code AND the explanation, lisa! :D