Im trying to make a animation play every time you equip a tool. It works when i equip it, but when i unequip it, the animation keeps on playing.
The error is: Humanoid is not a valid member of Backpack "Players.fireyfoxninja21.Backpack" - Server - Animation:17
Can anybody help figure out why this wont work?
(I used a normal script inside of a tool, with a handle.)
local Tool = script.Parent
local Animation = Tool.Animation
Tool.Equipped:Connect(function()
local Player = Tool.Parent
local Humanoid = Player.Humanoid
local AnimationPlay= Humanoid:LoadAnimation(Animation)
AnimationPlay:Play()
end)
Tool.Unequipped:Connect(function()
local Player = Tool.Parent
local Humanoid = Player.Humanoid
local AnimationPlay = Humanoid:LoadAnimation(Animation)
AnimationPlay:Stop()
end)
