Inside of a sword I have a local script inside called Animation. Everything works perfect, it plays the animations at the right time.
My issue is that when you unequip the tool, it still keeps the animations the same even after re-enabling the original Animate script.
local idle = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.idle)
local jump = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.jump)
local run = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.run)
local attack = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.attack)
script.Parent.Equipped:Connect(function()
idle:Play()
script.Parent.Parent.Animate.Disabled = true
game.Players.LocalPlayer.Character.Humanoid.Jumping:connect(function()
jump:Play()
game.Players.LocalPlayer.Character.Humanoid.StateChanged:connect(function()
local state = game.Players.LocalPlayer.Character.Humanoid:GetState()
if state == Enum.HumanoidStateType.Landed then
jump:Stop()
idle:Play()
end
end)
end)
game.Players.LocalPlayer.Character.Humanoid.Running:connect(function(speed)
if speed > 0 then
run:Play()
idle:Stop()
elseif speed == 0 then
run:Stop()
idle:Play()
end
end)
script.Parent.Unequipped:connect(function()
game.Players.LocalPlayer.Character.Animate.Disabled = false
end)
end)
Whether the Unequipped function is inside or outside of the Equipped function, it's the same results.

1 comment
Thank You!