The script I have plays an animation in an NPC named Martin. After 3 seconds, I want the animation to stop, but the animation still continues to loop after 3 seconds. Here is the script --
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://4594895034"
local controller = game.Workspace.Martin.Zombie -- path to Humanoid/AnimationController
controller:LoadAnimation(anim):Play()
wait(3)
anim:Stop()
The "anim:Stop()" part just doesn't work. The script is located in Workspace, and holds the animations that I want to use for the NPC.

1 comment
Thank you!