Hey devs!
Running into an issue with a speaker system I’m trying to make where it plays the same ID at the same time at random on all the speakers.
It won’t load any of the IDs which are public and all work.
Here’s what I got:
Handler:
local val = script.Value
local MusicData = {9038476333,1839945406,1838667039,1838091800,1839945272,1846627694,1841241297}
local function change()
local newSound = MusicData[math.random(1,#MusicData)]
game.ReplicatedStorage.StartSong:FireAllClients(newSound)
end
change()
while wait() do
script.DecidingSound.Ended:Connect(function()
change()
print("ID Changed!")
end)
end
Script inside Speaker:
while wait() do
if not script.Parent.Sound.IsPlaying then
wait(1.5)
local id = "rbxassetid://"..tostring(game.ServerScriptService.MusicDecider.Value.Value)
script.Parent.Sound.SoundId = id
script.Parent.Sound:Play()
wait(1)
wait(game.ServerScriptService.MusicDecider.DecidingSound.TimeLength)
end
end
Any help appreciated. Thanks!