I tried this script, but when I unequip the sword, it stays on the position it was when the animation ended
local tool = script.Parent -- use local variables
local Player = game.Players.LocalPlayer --get the local player
local isitEquipped = Player.hasWeapon
tool.Equipped:Connect(function(mouse) -- :Connect not :connect, :connect is deprecated
isitEquipped.Value = true
local attack = tool.Parent.Humanoid:LoadAnimation(script.equipAnimation) -- script.Parent is tool so just use tool.Parent
attack:Play()
wait(attack.Length - 0.1)
attack:AdjustSpeed(0)
end)
tool.Unequipped:connect(function()
isitEquipped.Value = false
local getName = script.Parent.Parent.Parent.Name
local attack = workspace:FindFirstChild(getName).Humanoid:LoadAnimation(script.equipAnimation)
local idle = workspace:FindFirstChild(getName).Humanoid:LoadAnimation(script.Idle)
attack:AdjustSpeed(1)
wait(0.1)
attack:AdjustSpeed(1)
attack:Stop()
end)
How do I make it go back to the position it was before the animation?

1 comment
I think he means stop animations and go to his other animation.