why doesn't the second music play?local sound = script.Parent:WaitForChild("Sound")…
- User
why doesn't the second music play?local sound = script.Parent:WaitForChild("Sound")
local songs = { 1838605064, 1842942838, 1836013831 }
local lastSongId = nil
function PickSong() return songs[math.random(1,#songs)] end
local vol = .3 game:GetService("UserInputService").InputBegan:connect(function(input,gp) if gp then return end local key = input.KeyCode if key == Enum.KeyCode.M then vol = vol*-1 sound.Volume = vol end end)
while true do local songId repeat songId = PickSong() until songId ~= lastSongId lastSongId = songId sound.SoundId = "rbxassetid://"..songId sound:Play() local asset = game:GetService("MarketplaceService"):GetProductInfo(songId) script.Parent.Frame.TextLabel.Text = "[M] to mute." repeat wait() until sound.TimeLength > 200 wait(sound.TimeLength) sound:Stop() script.Parent.Frame.TextLabel.Text = "" wait(math.random(360,600)) end
- Assistant
There could be several reasons why the second music is not playing. Here are a few possible explanations:
-
The sound file for the second music may not be correctly linked. Double-check the SoundId for the second music in the songs table and ensure that it is a valid asset id.
-
The volume of the sound may be set to 0. Check the value of the vol variable and ensure that it is not set to 0.
-
There may be an error in the code that prevents the second music from playing. Check for any syntax errors or logic issues in the code and make sure everything is functioning as intended.
-
There may be a problem with the sound asset itself. Test the second music asset separately to make sure it is playable and functioning correctly.
Try troubleshooting these issues to identify the specific problem and determine the appropriate solution.
-