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

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

Asked by 9 years ago

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

0
Could you be a bit more specific? You wrote wait 0, which doesn't help much Shawnyg 4330 — 9y

1 answer

Log in to vote
0
Answered by
iNicklas 215 Moderation Voter
9 years ago
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

0
What i want is, after the music stops, it starts again after a while 12345gabriel12345 15 — 9y
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. iNicklas 215 — 9y
0
ah ok, I'll test 12345gabriel12345 15 — 9y
0
Wow, Thank You!! It worked perfectly! 12345gabriel12345 15 — 9y
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. iNicklas 215 — 9y
Ad

Answer this question