Why wont the dummy animate?

Hello, so I am currently trying to make this dummy or npc to have an idle animation. However with this script it wont do anything. Animation wont work

local animation = script:WaitForChild('Animation')
local humanoid = script.Parent:WaitForChild('Humanoid')
local idle = humanoid:LoadAnimation(animation)
idle:Play()
idle.Looped = true

For one thing, Humanoid:LoadAnimation has been deprecated, use Animator | Roblox Creator Documentation.
Secondly, your local animation is referring to the animation instance, not it’s animation id, instead it should be

local animation = script:WaitForChild("Animation").AnimationId

The same link provides an example script on playing animations locally, I suggest you refer to that.