Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

This npc script runs but does not move the npc, why?

Asked by 6 years ago

This script that I made does not move the npc to these parts in the workspace. The script runs through the loop but the npc in workspace does not budge.

while true do
    wait()
    script.Parent["v1"].Humanoid:MoveTo(script.Parent.pp.Position)
    script.Parent["v1"].Humanoid.MoveToFinished:wait()
    script.Parent["v1"].Humanoid:MoveTo(script.Parent.Part.Position)
    script.Parent["v1"].Humanoid.MoveToFinished:wait()
end

3 answers

Log in to vote
0
Answered by 6 years ago

You put the move to part to the script, change it to the part you want it to.

0
No, he didn't. He actually referenced the part's parent, and then referenced a part. Eqicness 255 — 6y
Ad
Log in to vote
0
Answered by
OfcPedroo 396 Moderation Voter
6 years ago

I think the problem is in MoveToFinished, which I think that doesn't exist. Try the following:

while wait() do
    script.Parent["v1"].Humanoid:MoveTo(script.Parent.pp.Position)
    game.Workspace.Player.Humanoid.Running:connect(function(speed)
        if speed < 0 then
            script.Parent["v1"].Humanoid:MoveTo(script.Parent.Part.Position)
            end
    end)
end

0
Doesn't work. 951753lolguy 2 — 6y
0
Strange... OfcPedroo 396 — 6y
Log in to vote
0
Answered by
Eqicness 255 Moderation Voter
6 years ago

I believe your problem is that MoveTo is a bit weird... Try instead of using Position using part.CFrame.p, and try using a part instead of a position, or both. Try messing with it, and also, OfcPedroo, MoveToFinished is a valid event of the humanoid.

Answer this question