So I have this script right here:
local Player = game.Players.LocalPlayer
Songs = script["Music"]:GetChildren()
Selected = nil
MTL = .25
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function Song()
Random = Songs[math.random(1,#Songs)]
Selected = Random
script.Parent.Playing.Playing.Text = Selected.Name
wait()
for i = 1,#Selected:GetChildren(),1 do
Selected:GetChildren()[i]:Play()
wait(Selected:GetChildren()[i].Duration.Value-MTL)
end
end
while true do Song() end
Player.Character.Humanoid.Died:connect(function()
for Index,A in pairs(Selected:GetChildren()) do
if A:IsA("Sound") then
A:stop()
end
end
end)
Within this script is a backpack containing twenty-four other backpacks named after the names of songs. Within those backpacks are sounds, every sound named '1'. Inside of THAT, I have a NumberValue with the value of '120'. Is there a better way I can do this or am I doing something horribly wrong?
