I'm making a sword where when you click your WalkSpeed is set to 0, but I still want the player to walk forwards a little to go with the attack animation. I don't know if MoveTo is the best option cause I'm a noobie scripter. I've considered BodyForce, but MoveTo sounds like the better option.
local h = script.Parent.Parent.Humanoid
function onActivated()
h:MoveTo(Vector3.new(6,0,0)
script.Parent.Activated:connect(onActivated)
I'm just trying to get the player to move forward 6 studs when they click. (i guessed on the x,y,z I'll trial and error that later)
I gave the script pretty much every idea I had, which was very few, so any help/ideas are very much appreciated!

7 comments
first time having trouble with the title... wasn't concise yet specific enough apparently..
this script is intended for R6 if that's important btw!
you are missing a parenthesis on line 4, it should be h:MoveTo(Vector3.new(6,0,0))
also, this moves them to the position 6,0,0 every time, and it doesn't take the player's current position into account
thank you! I'll do some searching on getting the players position and what not
You can't use MoveTo() if the walkspeed is set to 0.
I'll just set the walkspeed to 4 or something. It shouldn't effect what my end goal is. TY