Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how to make a player walk to a certain point?

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?

3 comments

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.

1

-7 reppers these days ^

0

Facts neil, "its quite complicated" bahaha

1 answer

✓ Accepted answer

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)

4 comments

0

but theres one thing, when the player moves manually, they dont walk to the desired poition anymore.

0

im thinking one of those like from loomian legacy or somethin

0

anyways, ill ask that later.

This discussion is preserved as it was. New answers, comments, and votes are closed.