of     1   

XIaine
#217747026Tuesday, May 30, 2017 5:11 PM GMT

I want to have a five second pause between each loop of this sound. What can I add or change to make it do that? local enabled = true script.Parent.ClickDetector.MouseClick:connect(function() if enabled == true then if script.Parent.Sound.IsPlaying == false then script.Parent.Sound:Play() end end enabled = false end) -𝓧
micheal999990
#217747186Tuesday, May 30, 2017 5:13 PM GMT

After then maybe add wait(5) but i dont understand what you want to do
Goulstem
#217747454Tuesday, May 30, 2017 5:18 PM GMT

If the `Looped` Property of the Sound is true, the audio will play instantaneously. Try dis. local sound = script.Parent:WaitForChild("Sound"); script.Parent.ClickDetector.MouseClick:Connect(function() if not sound.IsPlaying then wait(5); sound.Looped = false; sound:Play(); end end)
Goulstem
#217747529Tuesday, May 30, 2017 5:19 PM GMT

Or if you mean 5 secs in between -being able- to loop it(as in a cooldown), you can add a debounce. local sound,db = script.Parent:WaitForChild("Sound"),false; script.Parent.ClickDetector.MouseClick:Connect(function() if not db then db = true; if not sound.IsPlaying then sound.Looped = false; sound:Play(); end wait(5) db = false; end end)
XIaine
#217747782Tuesday, May 30, 2017 5:23 PM GMT

Neither of the scripts seemed to work as I need. Basically how I need it to work is this: Sound plays Wait 5 Sound plays Wait 5 Sound plays Wait 5 Etc Etc Etc -𝓧
Goulstem
#217747989Tuesday, May 30, 2017 5:27 PM GMT

You should use a `while` loop, then. local sound = script.Parent:WaitForChild("Sound"); local connection; connection = script.Parent.ClickDetector.MouseClick:Connect(function() connection:Disconnect(); sound.Looped = false; while wait(5) do sound:Play(); sound.Stopped:Wait(); end end) R$33,025
XIaine
#217748333Tuesday, May 30, 2017 5:33 PM GMT

Still didn't seem to work. I think all that script did was make it wait five seconds once, but then continued to loop itself without the five second pause inbetween -𝓧
Goulstem
#217749382Tuesday, May 30, 2017 5:49 PM GMT

Seems like the `Stopped` event wasn't firing. Try this lol local sound,db = script.Parent:WaitForChild("Sound"),false; script.Parent.ClickDetector.MouseClick:Connect(function() if not db then db = true; sound.Looped = false; while wait(5) do sound:Play(); repeat wait() until not sound.IsPlaying; end end end) R$33,025
XIaine
#217749830Tuesday, May 30, 2017 5:57 PM GMT

Still does nothing :( Output says this: >Script 'Workspace.Zombie.Head.Sound Script', Line 3 -𝓧
XIaine
#217750083Tuesday, May 30, 2017 6:00 PM GMT

Well, there's no ClickDetecter in the model so it's not really needed. But other than that, it doesn't say anything about why it's not pausing in between loops -𝓧
Goulstem
#217767073Tuesday, May 30, 2017 9:56 PM GMT

"Well, there's no ClickDetecter in the model so it's not really needed. But other than that, it doesn't say anything about why it's not pausing in between loops" .-. If there's no ClickDetector why are you trying to DETECT FREAKIN CLICKSSSSSSS
XIaine
#217815770Wednesday, May 31, 2017 12:12 PM GMT

It's a script I ripped from another model LOL But the problem was, was that I had loop checked off in the sound part. After unchecking it, it works perfectly now. :] Thank yoooouuuuu! -𝓧

    of     1