Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I stop a looped sound when I am not using a tool?

Asked by 10 years ago

I am trying to make a chainsaw tool. I had used the sword script that is commonly used in most swords.

But I want the chainsaw to make a looped sound when it is idle. But when I unequip the tool it keeps on looping the sound. I want to get rid of the looping sound after I am not holding on to the tool.

1 answer

Log in to vote
3
Answered by
MrFlimsy 345 Moderation Voter
10 years ago

Listen for the Unequipped event, then call Stop() on the sound.

tool.Unequipped:connect(function()
    game.Workspace.Sound:Stop()
end)

Replace "tool" with the path to your tool and "game.Workspace.Sound" with the path to your sound.

Ad

Answer this question