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

Music script doesn't work? [read comment]

Here's the script:


local s = Instance.new("Sound")

s.Name = "Sound"
s.SoundId = "http://www.roblox.com/asset/?id=155416960" 
s.Volume = 2                                                  --SONG 1
s.Pitch = 1 
s.Looped = false
s.archivable = false

s.Parent = game.Workspace

wait(0)

s:play()

wait(120) --waits until the next song plays


local s = Instance.new("Sound")

s.Name = "Sound"
s.SoundId = "http://www.roblox.com/asset/?id=151846965" 
s.Volume = 2 
s.Pitch = 1                                                    --SONG 2
s.Looped = false
s.archivable = false

s.Parent = game.Workspace

wait(0)

s:play()

wait(120) --waits until the next song plays

local s = Instance.new("Sound")

s.Name = "Sound"
s.SoundId = "http://www.roblox.com/asset/?id=143045877" 
s.Volume = 2 
s.Pitch = 1                                                    --SONG 3
s.Looped = false
s.archivable = false

s.Parent = game.Workspace

wait(0)

s:play()


repeat(infinite) --IDK how to repeat it for infinite, help? 
--BTW the repeat means i want it to repeat the whole script for infinite

So, It doesn't work. I want this script to play 3 songs, but it doesn't work.

1 comment

0

THE SCRIPT NOW WORKS

2 answers

✓ Accepted answer

Try this

while true do



local s = Instance.new("Sound")

s.Name = "Sound"
s.SoundId = "http://www.roblox.com/asset/?id=155416960" 
s.Volume = 2                                                  --SONG 1
s.Pitch = 1 
s.Looped = false
s.archivable = false

s.Parent = game.Workspace

wait(0)

s:play()

wait(120) --waits until the next song plays


local s = Instance.new("Sound")

s.Name = "Sound"
s.SoundId = "http://www.roblox.com/asset/?id=151846965" 
s.Volume = 2 
s.Pitch = 1                                                    --SONG 2
s.Looped = false
s.archivable = false

s.Parent = game.Workspace

wait(0)

s:play()

wait(120) --waits until the next song plays

local s = Instance.new("Sound")

s.Name = "Sound"
s.SoundId = "http://www.roblox.com/asset/?id=143045877" 
s.Volume = 2 
s.Pitch = 1                                                    --SONG 3
s.Looped = false
s.archivable = false

s.Parent = game.Workspace

wait(0)

s:play()


end

I hope this helps.

local ListOfMusic={155416960,151846965,143045877}
local Start = true

function MakeSounds(Parent)
if Start then
for i=1,#ListOfMusic do
local s=Instance.new("Sound",Parent)
s.SoundId="http://www.roblox.com/asset/?id="..ListOfMusic[i]
s.Looped=true
s.Volume = 2
s.Pitch = 1
s.archivable = false
repeat wait(1.5) s:Stop() wait(2.5)s:Play() wait(.5)s:Stop() until s.IsPlaying --This may not work.
elseif not Start then
print("Set Start to true for music to play")
end end

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