Just moving along waypoints

Post Reply
RainerWahnsinn
Posts: 2
Joined: Sun Feb 12, 2017 9:26 pm

Just moving along waypoints

Post by RainerWahnsinn » Thu Oct 12, 2017 12:53 am

Hey,

I'm looging for a script that just let my move the wayponints along. I want my templar to stay in "barricade of steel" and just moving some points and kiting mobs till they die on my reflect shield.
can someone help me please?

cooco
VIP
Posts: 218
Joined: Fri Feb 17, 2017 2:01 am
Has thanked: 58 times
Been thanked: 85 times

Re: Just moving along waypoints

Post by cooco » Fri Oct 13, 2017 12:19 am

You can do it.

How to active skill

Code: Select all

PlayerInput:Ability("Ability name")
You can check skill cooldown, retrive to you CD in second

Code: Select all

AbilityList:GetAbility("Ability name")
You can move your character with (can get x,y,z coordinate from Cheating 2.8 Form)

Code: Select all

Player:SetMove(x, y, z)
You can start writing your own script now :mrgreen:

User avatar
smaion40
Posts: 83
Joined: Tue Apr 25, 2017 12:11 pm
Has thanked: 42 times
Been thanked: 16 times

Re: Just moving along waypoints

Post by smaion40 » Sat Oct 21, 2017 6:57 pm

cooco wrote:
Fri Oct 13, 2017 12:19 am

You can move your character with (can get x,y,z coordinate from Cheating 2.8 Form)

Code: Select all

Player:SetMove(x, y, z)
Hello cooco, I have a question regarding this command, I'm using it to make my character follow a coordinate list, but its only using the last one of the list.

Example:

Code: Select all


	Player:SetMove(400.32, 290.78, 198.64); 
	Player:SetMove(394.82, 288.41, 198.69);
	Player:SetMove(387.57, 285.87, 198.63);
	Player:SetMove(381.20, 283.61, 198.47); 
	Player:SetMove(374.74, 280.62, 198.20);
	Player:SetMove(369.45, 276.22, 198.13); 
	Player:SetMove(365.94, 272.59, 198.11); 
	Player:SetMove(361.53, 268.92, 197.61); 
	Player:SetMove(356.11, 265.92, 195.76);
	Player:SetMove(351.17, 264.39, 194.52); 
	Player:SetMove(345.48, 263.20, 193.54); 
	Player:SetMove(340.58, 262.21, 193.05); 
	Player:SetMove(334.41, 261.32, 193.00); 
	Player:SetMove(329.28, 260.71, 192.62); 
	Player:SetMove(323.57, 260.34, 192.32); 
	Player:SetMove(318.28, 260.06, 191.54); 
	Player:SetMove(313.29, 259.85, 191.02); 
	Player:SetMove(307.88, 259.69, 191.02); 
	Player:SetMove(302.68, 259.60, 191.02); 
	Player:SetMove(295.79, 259.50, 191.02); 
	Player:SetMove(289.47, 259.44, 191.02); 
	Player:SetMove(284.15, 259.39, 191.02); 
	
	
In this case my character travels directly to Player:SetMove(284.15, 259.39, 191.02);.

Is there a way to make it follow each coordinate at a time?.

cooco
VIP
Posts: 218
Joined: Fri Feb 17, 2017 2:01 am
Has thanked: 58 times
Been thanked: 85 times

Re: Just moving along waypoints

Post by cooco » Sat Oct 21, 2017 10:03 pm

You have to check if the target coordinate is reached. For example

Code: Select all

currentPosition = Player:GetPosition(); -- retrieve the current position (x, y, z)

-- If our distance to target coordinate is less than 1 then move to next coordinate
if Player:GetPosition():DistanceToPosition(currentPosition) <= 1 then
	--Move next coordinate
end

User avatar
smaion40
Posts: 83
Joined: Tue Apr 25, 2017 12:11 pm
Has thanked: 42 times
Been thanked: 16 times

Re: Just moving along waypoints

Post by smaion40 » Sat Oct 21, 2017 10:31 pm

cooco wrote:
Sat Oct 21, 2017 10:03 pm
You have to check if the target coordinate is reached. For example

Code: Select all

currentPosition = Player:GetPosition(); -- retrieve the current position (x, y, z)

-- If our distance to target coordinate is less than 1 then move to next coordinate
if Player:GetPosition():DistanceToPosition(currentPosition) <= 1 then
	--Move next coordinate
end
So every coordinate must be checked individually with that position fuction?, or I can create an array or something to check them all?.

I'm trying to implement that function but it keeps sending me to the last coordinate and then rubberbanding to the original location :(

cooco
VIP
Posts: 218
Joined: Fri Feb 17, 2017 2:01 am
Has thanked: 58 times
Been thanked: 85 times

Re: Just moving along waypoints

Post by cooco » Sat Oct 21, 2017 10:57 pm

Usually i put coordinate in array

Code: Select all

coordinate = {}
coordinate[1] = {x,y,z}
coordinate[2] = {x,y,z}
coordinate[3] = {x,y,z}
coordinate[4] = {x,y,z}
then use a counter to loop this array

Code: Select all

arrayCount = 0

Code: Select all

currentPosition = Player:GetPosition(); -- retrieve the current position (x, y, z)

-- If our distance to target coordinate is less than 1 then move to next coordinate
if Player:GetPosition():DistanceToPosition(currentPosition) <= 1 then
	arrayCount = arrayCount + 1;
	Player:SetPosition(coordinate[arrayCount]);
end
Then you need to adapt code for your script :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest