local a={}local x=script.Parent:GetChildren()for x,B in pairs(x)do if B:IsA("\073\110\116\086\097\108\117\101")and B.Name=="\077\117\115\105\099\073\100"then table.insert(a,B.Value)end end local B=Instance.new("\083\111\117\110\100",script.Parent)B.Name="\077\117\115\105\099\080\108\097\121\101\114"if looped==true then B.Looped=true else B.Looped=false end B.Pitch=pitch B.Volume=volume while true do B.SoundId="\114\098\120\097\115\115\101\116\105\100\058\047\047"..a[math.random(1,#a)]B:Play()wait(songPlayTime)B:Stop()wait(nextSongPlayTime)end


local songValues = {}
local songs = script.Parent:GetChildren()

for i,v in pairs(songs) do
	if v:IsA("IntValue") and v.Name == "MusicId" then
		table.insert(songValues, v.Value)
	end
end

local sound = Instance.new("Sound",script.Parent)
sound.Name = "MusicPlayer"

if looped == true then
	sound.Looped = true
else
	sound.Looped = false
end

sound.Pitch = pitch
sound.Volume = volume

while true do
	sound.SoundId = "rbxassetid://"..songValues[math.random(1,#songValues)]
	sound:Play()
	wait(songPlayTime)
	sound:Stop()
	wait(nextSongPlayTime)
end
