Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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.

0
Plz, use the codeblock plz, and I hope you fix the indentation! Tizzel40 243 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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.

Ad

Answer this question