I’ve got this melee weapon with a durability code line. It works, but when it destroys itself after it’s durability has been used, it keeps the hold animation in another script. I’m not really sure how I can reset the animation…
if it helps, here’s the holdanimation script
--CONFIG----------------------------------------------------------
local holdanimationid = 7455443488 --Enter hold animation ID here
------------------------------------------------------------------
repeat wait() until game.Players.LocalPlayer.Character
local lp = game.Players.LocalPlayer
local sp = script.Parent
local debounce = true
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://" .. holdanimationid
local holdtrack = lp.Character.Humanoid:LoadAnimation(anim)
sp.Equipped:connect(function()
holdtrack:Play()
end)
sp.Unequipped:connect(function()
holdtrack:Stop()
end)