How to detect if a npc is walking

How do I check if a NPC is walking?

The humanoid has an event named “Running”. And theres other event named “MoveToFinished”. So you can make this:

local isRunning = false

humanoid.Running:Connect(function()
    isRunning = true
    humanoid.MoveToFinished:Wait()
    isRunning = false
end)

I tried the code but it didn’t work

I am trying to make a walking animation

You can copy the animate script from a player character model and paste it in a normal script and put it in the NPC.

it was a mistype lol
i forgot to add .value