I’m trying to make the animation stop on the last frame but I’m experiencing a problem with the debug output test printing but its not stopping, thanks in advance.
local tool = script.Parent
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://(ANIMATIONID)"
tool.Activated:Connect(function()
local character = tool.Parent
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
local animator = humanoid:FindFirstChildOfClass("Animator")
if not animator then
animator = Instance.new("Animator")
animator.Parent = humanoid
end
local track = animator:LoadAnimation(animation)
track.Priority = Enum.AnimationPriority.Action
track.Looped = false
track:GetMarkerReachedSignal("End"):Connect(function()
print("test")
track:Stop()
end)
track:Play()
end
end)
