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

Music script doesn't work? [read comment]

Asked by 10 years ago

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.

0
THE SCRIPT NOW WORKS PyccknnXakep 1225 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago

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
Ad
Log in to vote
0
Answered by 10 years ago

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

Answer this question