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

How to make music play all the time?

Asked by
F_lipe 135
10 years ago

How could you script it to where it always plays music and loops through several songs?

2 answers

Log in to vote
1
Answered by 10 years ago

For one song you could use:

local sound = Instance.new("Sound")
sound.Name = "Background Music"
sound.SoundId = "http://www.roblox.com/asset/?id="
sound.Parent = game.Workspace
sound.Volume = 1
sound.Looped = true
SongLength = <Length Of Song (Your Input)>

wait(5)

while true do 
sound:Play()
wait(SongLength)
sound:Pause()
end

If you can think of how to do it with just that it might work.

Ad
Log in to vote
-1
Answered by 10 years ago

A more simple way is to insert a Script in Workspace and then Insert a Sound with the Script as it's parent. Now that you have the Script with the Sound in it what you want to do is get the Audio's ID and paste it into the Sound's property for that (I forgot the Property name but you can easily find it :P) but with "http://www.roblox.com/asset/?id=" before the ID number (Don't put the "). Once you have done that just go and put this in the script:

script.Sound:Play()

This works for me and is the fastest way to do it. :)

P.S. you don't have to put the properties in the script, you can just edit the properties of the sound.

Answer this question