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

Is Humanoid:MoveTo() Broken?

I have a script which mimics the classic click-to-walk style of ROBLOX, but Humanoid:MoveTo() doesn't seem to work. m is PlayerMouse, p is player, h is Humanoid, g is just a random brick

print('Movement ' .. p.Name .. ' started.')
h:MoveTo(Vector3.new(m.Hit.X, m.Hit.Y, m.Hit.Z), g)

...which fires on-click. I am positive it's a problem with the Humanoid:MoveTo(), because everything else in the function works, including the print()

Is Humanoid:MoveTo() broken?

2 comments

0

No, I've been playing around with a script recently that uses MoveTo() without a hitch. Could the problem be with g? I've only used Vector3 values for MoveTo() and don't know if it can take another value like that.

0

Keep in mind, there are 2 different :MoveTo() methods: One as a method of a model, and one as a method of Humanoid. The second one requires any random Brick for the last parameter.

1 answer

No, it's not broken. Your problem is with m.Hit.X.

The X should actually be x. That is, the properties are lowercase, not uppercase. So the fix for your code is:

h:MoveTo(Vector3.new(m.Hit.x, m.Hit.y, m.Hit.z), g)

But the thing is, you don't need to do what you're doing.

Saying Vector3.new(m.Hit.x, m.Hit.y, m.Hit.z) is really just duplicating m.Hit.p, so replace it with that:

h:MoveTo(m.Hit.p , g)

4 comments

0

I wish I had known the x, y, and z were lowercase when I attempted a anti spawn kill script. I posted on the scripting helpers forum trying a technique with position, and got very little useful help, they were trying to get me to do magnitudes... Anyways, you helped me so Upvote!

0

Well, that seems like it would work, but I still have the same issue after switching to h:MoveTo(m.Hit.p , g).

0

What seems to be the problem, exactly? Is it crashing? If so, what is the output? What is it doing instead?

0

What is it doing? Nothing. Absolutely nothing. No errors, nothing.

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