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

Help With Random Movement?

script.Parent.Zombie:MoveTo(Vector3.new(script.Parent.Torso.Position) + Vector3.new(math.random(-5,5),0,math.random(-5,5)))

this script is supposed to send the zombie to kinda wonder around randomly. It will go a few studs to X and a few studs to Z. But instead of that, it's trying to go the the coordinates that the math.random gets, rather than just add on to where it already is.... Help?

1 answer

✓ Accepted answer

You're trying to do Vector3.new(script.Parent.Torso.Position), and script.Parent.Torso.Position is already a Vector3. Just use it as-is:

script.Parent.Zombie:MoveTo(script.Parent.Torso.Position + Vector3.new(math.random(-5,5),0,math.random(-5,5)))

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