That’s what I did too. Same error, attepmt to index nil with “Length”…
wait do you have animations in a folder or on a table?
In a folder. I get the table with :GetChildren()
if ur still having problems with it being nil try this
local animationsFolder = script.Parent.Folder:GetChildren()
local ChosenAnimation = animationsFolder[math.random(1,#animationsFolder)]
local anim = game.Players.LocalPlayer.Character.Humanoid.Animator:LoadAnimation(ChosenAnimation)
anim:Play()