I want to make it where when i equip a tool a animation plays, and when i unequip it, the animation should stop. When i unequip it, the animation still plays.
help
local Tool = script.Parent
local Animation = Tool.Animation
Tool.Equipped:Connect(function()
local Player = Tool.Parent
local Humanoid = Player.Humanoid
local Animator = Instance.new("Animator")
local AnimationPlay = Humanoid.Animator:LoadAnimation(Animation)
AnimationPlay:Play()
end)
Tool.Unequipped:Connect(function()
local Player = Tool.Parent
local Humanoid = Player.Humanoid
local Animator = Instance.new("Animator")
local AnimationPlay = Humanoid.Animator:LoadAnimation(Animation)
AnimationPlay:Stop()
end)
