If you want to animate them when attacked, use humanoid:LoadAnimation() the script can be in a hitbox or in the weapon
If you want them to have walking or jumping animations, you can grab your character localscript when starting the game (R6 or R15) and put it on the npc. The script is called “Animation”
If you want to put custom animations do the same but in the localscript children values change the Id of the animation for yours
You should have a reference, you can take an animated one from the toolbox, to find out if its similar to your npc, Animator or not, R6 or R15
Ok I think this is the solution, just copy the base, this will make the animation play for each of your npcs
If this doesnt help you, I cant do anything anymore…
for i,v in pairs(game.Workspace.NPCS:GetChildren()) do -- all the npcs
v.Touched:Connect(function() -- npc when touched
local Animation = Instance.new("Animation") -- creates the animation
Animation.AnimationId = "rbxassetid://0" -- your animation id
local Humanoid = v:FindFirstChild("Humanoid") -- npcs with humanoid
local animtrack = Humanoid:LoadAnimation(Animation) -- load the animation
wait(1) -- wait
animtrack:Play() -- Play your animation
end)
end
Create a folder called “NPCS” and there you put all your npcs, and they will make the animation when touched, but you do not need to copy the script