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

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

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

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

1 comment

0

No, he didn't. He actually referenced the part's parent, and then referenced a part.

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

2 comments

0

Doesn't work.

0

Strange...

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.

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