Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

how to make a player walk to a certain point?

Asked by 5 years ago
Edited 5 years ago

ok so im trying to make a game where the players character walks to a point within the game. (without them manually controlling the player)

now i am trying to make a model of this, for later use, and i have a part named aaa in the workspace, and a part in the workspace with a script:

script.Parent.Touched:Connect(function(s)
    local humanoid = s.Parent:WaitForChild('Humanoid')
    humanoid.WalkToPoint = Vector3.new(91, 0.5, 131.75)
end)

it works, the player walks to the aaa, but theres this issue when player tries to control themselves, they snap and are able to control themselves again, can somebody help me please?

0
I don't think WalkToPoint is a member of humanoid. I'm not sure though try using some Animations and things. This is quite complicated because if the script works then you also need to disable them from moving their own character. Rynappel 212 — 5y
1
-7 reppers these days ^ greatneil80 2647 — 5y
0
Facts neil, "its quite complicated" bahaha Psudar 882 — 5y

1 answer

Log in to vote
0
Answered by
Psudar 882 Moderation Voter
5 years ago
Edited 5 years ago

You got the right idea going. You actually just have to do this:

-Get the humanoid from the player's character;

-Use the Humanoid:MoveTo() method

script.Parent.Touched:Connect(function(s)
   local position = Vector3.new(91, 0.5, 131.75)
    local humanoid = script.Parent:WaitForChild("Humanoid") --parented to character
    humanoid:MoveTo(position) --call MoveTo() on humanoid
end)
0
but theres one thing, when the player moves manually, they dont walk to the desired poition anymore. harris38637 22 — 5y
0
im thinking one of those like from loomian legacy or somethin harris38637 22 — 5y
0
anyways, ill ask that later. harris38637 22 — 5y
Ad

Answer this question