So basically I have a minor problem with my tool. When it's clicked, it will plasy a sound, and stops an idle sound, wait 7 seconds, then play the idle sound. The problem I'm having is that the idle sound stops when its unequipped, then 7 seconds later it plays again while the tool is still unequipped. I'm not sure how to check if the tool is unequipped then stop the sound, because it stops but only for 7 seconds then continues to play. here is the script if needed.
local spell = script.Parent spell.Equipped:Connect (function() spell.Handle.shieldidle.Looped = true spell.Handle.shieldidle:Play() spell.Handle.Equip.Pitch = 0.8 spell.Handle.Equip:Play() end) local debounce = false spell.Activated:Connect (function() if debounce then return end debounce = true spell.Handle.light.Brightness = 2 spell.Handle.shield:Play() spell.Handle.shieldidle:Stop() wait(7.4) spell.Handle.light.Brightness = 1 spell.Handle.shieldidle:Play() debounce = false end) spell.Unequipped:Connect(function() spell.Handle.shieldidle:Stop() spell.Handle.away:Play() spell.Handle.shield:Stop() end)
Use this where you want to check if the script is in the tool:
if script.Parent.Parent.Name == "Backpack" then --stuff here end
you may want to add a loop to check. Happy to help, b_mni.