-- DO NOT EDIT THE BELOW UNLESS YOU'RE A SCRIPTER AND KNOW WHAT YOU'RE DOING! --


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
