This local script should apply a walking animation to all of the enemies in my TDS game:

local function animateMob(object)
	local humaniod = object:WaitForChild("Humaniod")
	local animationsFolder = object:WaitForChild("Animations")
	
	if humaniod and animationsFolder then
		local walkAnimation = animationsFolder:WaitForChild("Walk")
		if walkAnimation then
			local animator = humaniod:FindFirstChild("Animator")
			local walkTrack = animator:LoadAnimation(walkAnimation)
			walkTrack:Play()
		end
	end
end

workspace.Mobs.ChildAdded:Connect()

However, it doesn't work and I've made multiple attempts at this. The local script is in StarterPlayerScripts and in ServerStorage. I have a folder called "Mobs" with all of the different enemies in it. The humanoids for all of the mobs have Animators and I added a config folder with the walk animation in it.