Faczki
(Faczki)
April 23, 2021, 4:59pm
1
So i just made this script to repeat through some musics and it didn’t work. Fun fact: I never actually tried this before, usually i just use 1 music in my games so this might be a simple error.
game.SoundService.music1.Ended:Connect(function()
script.Parent.music2:Play()
end)
game.SoundService.music2.Ended:Connect(function()
script.Parent.music3:Play()
end)
game.SoundService.music3.Ended:Connect(function()
script.Parent.music1:Play()
end)
M4NFO
(Manfo)
April 23, 2021, 5:04pm
2
Try using game:GetService(“SoundService”) instead of game.SoundService
Faczki
(Faczki)
April 23, 2021, 5:09pm
3
Tried it out, it still doesnt work
There’s been some weird instances with SoundService
not playing sounds that are replicated to the server, another alternate you could use is cloning the Sound and playing it that way instead? You got 2 choices here I’ll let you decide
M4NFO
(Manfo)
April 23, 2021, 5:14pm
5
Simply put Sound:Play() at the start, That should work perfectly I think
Faczki
(Faczki)
April 23, 2021, 5:16pm
6
The first music music1
already has the Playing
property turned true.
I think the Playing property is read only/doesn’t replicate. Try using Sound:Play() to play the music. Sound | Roblox Creator Documentation
M4NFO
(Manfo)
April 23, 2021, 5:27pm
8
You are using script.Parent, Use SoundService.Sound, And parent the script to ServerScriptService
1 Like
Faczki
(Faczki)
April 23, 2021, 5:28pm
9
I did both of that, and i don’t think it works still
M4NFO
(Manfo)
April 23, 2021, 5:28pm
10
Is it a Local Script or a Server script?
Faczki
(Faczki)
April 23, 2021, 5:29pm
11
It is a serverscript, as it’s in serverscriptservice
Faczki
(Faczki)
April 23, 2021, 5:31pm
12
local soundService = game:GetService("SoundService")
soundService.music1:Play()
soundService:WaitForChild("music1").Ended:Connect(function()
soundService:WaitForChild("music2"):Play()
end)
soundService:WaitForChild("music2").Ended:Connect(function()
soundService:WaitForChild("music3"):Play()
end)
soundService:WaitForChild("music3").Ended:Connect(function()
soundService:WaitForChild("music1"):Play()
end)
still doesn’t work, only the first music plays
Faczki
(Faczki)
April 23, 2021, 5:32pm
14
No, it ends and nothing else plays after that.
Just gonna put this here, attempting to play another sound after a sound has ended can result in some really weird Sound errors
1 Like
Faczki
(Faczki)
April 23, 2021, 5:36pm
16
Even if i did make a new instance, after all the other songs end, what would i do
Try… Game.SoundService.Music1:play()
You could just wait until all of the other songs have ended, then destroy the instance afterwards & create a new song:
game.SoundService.music1.Ended:Connect(function()
game.SoundService.music1:Destroy()
local Sound = script.Parent.music2:Clone()
Sound.Parent = script.Parent
Sound.Play()
end)
game.SoundService.music2.Ended:Connect(function()
game.SoundService.music2:Destroy()
local Sound = script.Parent.music3:Clone()
Sound.Parent = script.Parent
Sound.Play()
end)
game.SoundService.music3.Ended:Connect(function()
game.SoundService.music3:Destroy()
local Sound = script.Parent.music1:Clone()
Sound.Parent = script.Parent
Sound.Play()
end)
This wouldn’t be the best approach to handle it, but it’s an alternate
1 Like
I tested the same script and it seems to work for me. Are you sure it’s not playing? try adding prints inside the functions.
1 Like