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

MoveTo() - Unable to cast value to object?

script.Parent.Zombiod:MoveTo(script.Parent.Torso.Position.X + math.random(1,10),script.Parent.Torso.Position.Y, script.Parent.Torso.Position.Z + math.random(1,10))

This is run in a server script. Before I have told it to move to a position in a number and that worked but this doesnt work. The output says unable to cast value to object.

1 answer

You need to use a Vector3.

script.Parent.Zombiod:MoveTo(Vector3.new(script.Parent.Torso.Position.X + math.random(1,10),script.Parent.Torso.Position.Y, script.Parent.Torso.Position.Z + math.random(1,10)))

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