When the sound is finished, mute it

Hello,

What i need is when a sound is finished playing, then the volume will be 0.

Thats all,

Sincerely,
Milk

1 Like
local sound = workspace.Sound --change this to ur sound

sound.Ended:Wait()
sound.Volume = 0 -- u can just use sound:Stop() if it has looped checked

It works, but i need it for a sound that is updating mid game.

So u need to detect if it has changed?

The sound starts when my vehicle moves, so its updating while playing

Im so confused lmao, do u mean the volume changes or what…?

So, when i join the game. The sound is paused.
When i start moving my vehicle the engine sound starts playing.
But its a sound that only goes in the start of the vehicle moving.
So when the sound is finished, the sound would Stop playing.

So u need it to loop the audio or what
im still trying to process this lol
try this

local sound = workspace.Sound 

sound:GetPropertyChangedSignal("Playing"):Connect(function()
	sound.Ended:Wait()
	sound.Volume = 0 
end)

something like this
image

1 Like

if this doesnt work try using a while true loop

doesnt work, can i screenshare on discord with mute?
rukucc#7852

Nah no need, i now understand problem, ill try sum myself wait

Is the audio looped?

if the audio is looped, try this:

local sound = workspace.Sound 

sound:GetPropertyChangedSignal("Playing"):Connect(function()
	task.wait(sound.TimeLength)
	sound.Volume = 0 
end)

Not working, can i send you the whole script in private?

alright

longertexttttt

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.