Hi! I was just testing the :MoveTo() function of an npc’s humanoid, and ran into a little bug.
Here is the script:
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player)
while true do
Humanoid:MoveTo(player.Character.Torso.Position)
script.Parent.Humanoid.WalkSpeed = script.Parent.Humanoid.WalkSpeed + 1
wait()
end
end)
My issue is that I want the npc to constantly follow you smoothly, but the “wait()” in the while loop makes it follow you in a glitchy manner. Can anyone help me solve this please?
Thanks for the reply. I added this in, but when the npc gets close to you, he starts getting a little glitchy. Is there any way to fix that? Also I added it so he gets progressively faster as time progresses in the previous script.
Thanks. How can I do this? Because I don’t want the npc to start glitching while he walks near you, I just want him to keep walking straight to you, even maybe past you so he doesn’t stop and start glitching if u know what I mean