Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make a sound stop and start again after a while?

Example: I have a sound in my world, and the sound ends, and after a while he start again, but not start immediately

s = Instance.new("Sound")

s.Name = "Sound"
s.SoundId = "rbxassetid://130775373"
s.Volume = 0.1
s.Looped = true
s.archivable = false

s.Parent = game.Workspace

wait(1)

s:play()

im don't know how to do this if anyone can help me thank you

1 comment

0

Could you be a bit more specific? You wrote wait 0, which doesn't help much

1 answer

✓ Accepted answer
s = Instance.new("Sound")
s.Name = "Sound"
s.SoundId = "rbxassetid://130775373"
s.Parent = game.Workspace
s.Looped = true
s.Volume = 0.1

while true do

s:play()
wait(10) -- PLAY TIME
s:stop()
wait(10) -- PAUSE TIME

end

5 comments

0

What i want is, after the music stops, it starts again after a while

0

Yeah, thats what the script does. you can have it play for 10 seconds, then u can change it so it plays 3 seconds afterwards for 10 seconds again.

0

ah ok, I'll test

0

Wow, Thank You!! It worked perfectly!

0

No problem, the reason you might be confused is because it just says pause and then end? well, the while true do will loop that little piece of code i wrote between.

This discussion is preserved as it was. New answers, comments, and votes are closed.