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

moveto not working?

move = game.Workspace.NPC.Humanoid

while true do
move:MoveTo(13, 0.5, -8)
wait()
function MoveToFinished ()
    move:MoveTo(44, 0.5, -21)
    function MoveToFinished()
        move:MoveTo(13, 0.5, -27)
        function MoveToFinished()
            move:MoveTo(-34, 0.5, 55)
            function MoveToFinished()
                move:MoveTo(-1, 0.5, -24)

            end
        end
    end
end
end

it says Unable to cast value to Object in the output. its supposed to move the NPC around a ton. but like i said, unable to cast vaue to object

2 comments

0

move should be a model

0

move is a variable, why would i change it to a model?

1 answer

✓ Accepted answer

For some reason, when referring to the humanoid, MoveTo uses Vector3.

move = game.Workspace.NPC.Humanoid

while true do
move:MoveTo(Vector3.new(13, 0.5, -8))
wait()
function MoveToFinished ()
    move:MoveTo(Vector3.new(44, 0.5, -21))
    function MoveToFinished()
        move:MoveTo(Vector.new(13, 0.5, -27))
        function MoveToFinished()
            move:MoveTo(Vector3.new(-34, 0.5, 55))
            function MoveToFinished()
                move:MoveTo(Vector3.new(-1, 0.5, -24))

            end
        end
    end
end
end


1 comment

0

wow, the wiki is really out to get me today. thank you

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