Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I add custom animations for an enemy/npc?

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.

1 comment

0

Plz, use the codeblock plz, and I hope you fix the indentation!

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.