My tool is supposed to play a animation that when I click on it it plays a animation but my tool isn't doing that its doing the opposite when the animation is supposed to play when equipped its not playing when equipped it only plays when i equip the weapon and I have clicked to fire the event
here is my local script on this tool
tool = script.Parent animation = tool:WaitForChild("Animation") equip = false tool.Activated:Connect(function() if equip == true then Hum = tool.Parent:FindFirstChild('Humanoid') Hum:LoadAnimation(animation):Play() end end) tool.Equipped:Connect(function() equip = true end) tool.Unequipped:Connect(function() equip = false end)
tool = script.Parent animation = tool:WaitForChild("Animation") equip = false --move the equipped/unequipped functions above the activated function, so it can check whether equipped is true or false tool.Equipped:Connect(function() equip = true end)
tool.Unequipped:Connect(function() equip = false end)
tool.Activated:Connect(function() if equip == true then Hum = tool.Parent:FindFirstChild('Humanoid') Hum:LoadAnimation(animation):Play() end end)