how do i check when the npcs moves
i used this script but i miss the moving check
for i , folder in ipairs(workspace:WaitForChild("NPCS"):WaitForChild('Zombies'):GetChildren()) do
print(22)
local model = folder
local idleanim = game.ReplicatedStorage.Animations.Zombies.Idle
local runanim = game.ReplicatedStorage.Animations.Zombies.Run
local idle = model.Humanoid:LoadAnimation(idleanim)
local Anim = model.Humanoid:LoadAnimation(runanim)
idle.Priority = Enum.AnimationPriority.Idle
Anim.Priority = Enum.AnimationPriority.Movement
idle:play()
model.Humanoid.MoveToFinished:Connect(function(reached)
Anim:Stop()
end)
end