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

how do i make auto-looping music?

I don't know how to script this one, and I tried to ask for my friends, but there's didn't work.

Any solutions?

2 answers

Auto-looping music? I'm not exactly sure what you're trying to define by looping music with the same song or a list of songs.

However, when you're modifying a Sound Object, you can go over to the Properties and Select the checkbox on Behavior that says Looped while in ROBLOX Studio.

Hi, I'm TheEliteDonphan!

In order to make auto looping music, you have to find how long the music you are playing is. For this instance, I will use an audio that is two minutes long.

local sound = game.Workspace.Sound

Then you want to make a while loop, like this

local sound = game.Workspace.Sound

while wait(120) do -- 120 seconds is two minutes
end

Then in the while loop, add the code which makes the sound play : sound:Play()

local sound = game.Workspace.Sound

while wait(120) do
sound:Play()
end

Sources: myself

2 comments

0

where would I put the music in? and how do I find the time? and where would I insert that?

0

You would put the music in Workspace, and to find the time, just estimate. You put this script in ServerScriptStorage.

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