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

how do i make auto-looping music?

Asked by 10 years ago

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

Log in to vote
1
Answered by
Dummiez 360 Moderation Voter
10 years ago

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.

Ad
Log in to vote
0
Answered by
aalok 20
10 years ago

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

0
where would I put the music in? and how do I find the time? and where would I insert that? CrazyRocker60 17 — 10y
0
You would put the music in Workspace, and to find the time, just estimate. You put this script in ServerScriptStorage. aalok 20 — 10y

Answer this question