Hello scripting helpers.
I just recently made a script what plays random music.
Here is the script:-
function lose() -- Creates function
local loseservice = game.ServerStorage.LoseMusic:GetChildren() -- Gets the music
local loserandommusic = loseservice[math.random(1, #loseservice)] -- Gets random music
loserandommusic:Clone().Parent = game.Workspace -- Clones the random music into workspace
loserandommusic:Play() -- Plays the random music
wait(7)
loserandommusic:Stop() -- Stops the random music
loserandommusic:Destroy() -- Destroys the random music
end
The script successfully clones the random music into the workspace to play, however the music doesn't play, stop or destroy. There is also no errors in the console.
Does anyone know how to fix this?
Thanks, Nathan.

4 comments
Thanks for trying to help, however it still doesn't work. On the line loserandommusic=loserandommusic:Clone().Parent = game.Workspace , it errors and tells me that there is a unexpected symbol near '='. This is because there is two ='s on the same line.
Yea, I know, I updated it. It should work now. Thx for letting me know though.
Thanks! Works perfectly. Liked and answered.
Thanks, glad I could help! :P