Hello, I am trying to make a music player and it is making me furious. It is about the TimeLength. When I set it to the TimeLength it just cycles through a whole bunch of songs and it doesnt work.
--[[
-- Just create a model in Lighting named "Music", Insert music objects, and go!
make each music a different name.
]]
local player = game.Players.LocalPlayer
local musicplayer = "RandomMusicPlayer"
script.Name = "squidiskool's "..musicplayer
local stuff = game.Lighting:findFirstChild("Music") -- The name of the model where the music is. The model must be in Lighting!
if stuff ~= nil then
music = stuff:GetChildren()
print(""..musicplayer..": <Loaded!>")
wait(10)
print(""..musicplayer..": <Enabled!>")
if #music <= 0 then
print("[ERROR]"..musicplayer..": no music found in the music model")
else
while true do
local num = math.random(1,#music)
local currentmusic = music[num]:Clone()
wait(0.1)
print("New music: "..currentmusic.Name)
currentmusic.Parent = workspace
currentmusic:play()
wait(currentmusic.TimeLength)
currentmusic:pause()
currentmusic.Parent = game.Lighting
end
end
else
print("[ERROR]"..musicplayer..": Couldn't find the music model, make sure the model name is spelled correctly (caps sensitive)")
end

2 comments
just delete prints
No No No! It doesn't play the SONG at ALL! Prints need me to understand what this script it doing. IT IS JUST CYCLING THROUGH THE SONGS!