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

2 Likes
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
1 Like

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

1 Like

So u need to detect if it has changed?

1 Like

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

1 Like

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

1 Like

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.

1 Like

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)
1 Like

something like this
image

2 Likes

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.