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

How to script a pause in between looped audio?

Hi! So my problem is I have a short audio clip I want to play in the game I'm making, but the loops are too fast. I've experimented a bit myself but haven't come up with a solution. Here's the script I'm using:

local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://177529588"
sound.Parent = game.Workspace.Cross
sound.Volume = 1.6
sound.Looped=false
sound.PlaybackSpeed = 3
sound:play()

Thanks!

1 comment

0

It’s sound:Play(), not sound:play(). Where does it say to use :play()?

1 answer

✓ Accepted answer

You can do this by using the .Ended event on the sound.

When the sound ends, the Ended event will fire. We can make the script wait then play the audio again when the event fires.

Here's an example of how you would do it :

local Sound = SomeHierarchyIdk:WaitForChild('Sound')

Sound.Ended:Connect(function()
	wait(1) -- This will delay the loop
	Sound:Play()
end)

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