I'm scripting a trumpet tool that has a idle animation but when i equip the tool and unequipped it the animation doesn't stop, the animations plays and everything its just when i unequip the tool the idle animation doesn't stop? pls help
here's the script local Tool = script.Parent
local Handle = Tool:WaitForChild('Handle') local Player = game.Players.LocalPlayer local Character = Player.Character or Player.CharacterAdded:Wait() local Humanoid = Character:WaitForChild('Humanoid')
local Idle = 'rbxassetid://2992670514' local Toot = 'rbxassetid://2992700535'
local Debounce = 1
local Unequipped = true
local AnimTrack
Tool.Equipped:Connect(function() Unequipped = false if Unequipped == false then local Animation = Instance.new('Animation') Animation.AnimationId = Idle local LoadAnimation = Humanoid:LoadAnimation(Animation) LoadAnimation:Play() end end)
Tool.Activated:Connect(function() if Debounce == 1 then local Animation = Instance.new('Animation') Animation.AnimationId = Toot local LoadAnimation = Humanoid:LoadAnimation(Animation) LoadAnimation:Play() Debounce = 2 wait(3) Debounce = 1 end end)
Tool.Deactivated:Connect(function() if Debounce == 1 then local Animation = Instance.new('Animation') Animation.AnimationId = Idle local LoadAnimation = Humanoid:LoadAnimation(Animation) LoadAnimation:Play() end end)
Tool.Unequipped:Connect(function() local Animation = Instance.new('Animation') Animation.AnimationId = Idle and Toot local LoadAnimation = Humanoid:LoadAnimation(Animation) LoadAnimation:Stop() end)