I tried with a local script and a usual script none of them work
The code:
local Humanoid = script.Parent:WaitForChild("Humanoid")
local animation script.Parent.WalkAnim:WaitForChild(animation)
local anim = Humanoid:LoadAnimation(animation)
wait(3)
anim:Play()

1 comment
The :WaitForChild is not needed as the "WalkAnim" is the animation itself.