Ad
Log in to vote
0

How to loop sound?

Asked by
Nidoxs 190
7 years ago

I tried this.

while true do
    script.Parent.Sound:play() loop
end

[[-- Sound is in script and sound is set on loop?

2 answers

Log in to vote
0
Answered by 7 years ago

First of all your shouldn't use while true do end without a wait() like this

while true do wait(1)
 -- script
end

And second your sound will never play because you're trying to make it play() forever, but first of play() function the sound loads, resuming, the sound will load forever and not play.

In your sound's object, go to it's properties and set "Looped" to true.

If you want to set it via script use this line of code:

script.Parent.Sound.Looped = true
script.Parent.Sound:Play()

And it'll play forever.

I hope I help.

Ad
Log in to vote
0
Answered by 7 years ago

If you use while true do, it loops it.

while true do
script.Parent.Music:Play()
end

Or, simply go to your sound and then look under properties and check "Looped"

Hope this helped.

Answer this question