Whenever I've tried to add custom animations on an enemy/npc it's never worked. If anyone knows an animation for R6 playermodels it would help.
char = script.Parent hum = char.WaitForChild("Humanoid") animation = hum:LoadAnimation(script.Animation)
if char ~= nil then animation:Play() end
Here's the code that as being used at the moment made by my friend, which doesn't work.
Your code isn't bad it's just that you need to tell the script what type of animation to play. You can't just tell the animation to play. You can use instance.new and create an animation out of it and parent it to the NPC. Also remember to do "rbxassetid://Your Animation Here", to tell the script what type of animation to play. This is the easiest way I do it.