Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Audio and script in studio works fine, but not in game?

Asked by 4 years ago
local songs = {
    "2734529447", --fukashigi no carte
    "1130134720", -- sagun - i'll keep you safe ft. Siloh
    "4224086107", -- Darling in the franxx intro
    "714172354",  -- This will be the day - RWBY
    "932923622",  --Bad Apple!! 
    "1072013223", --peachy - falling for u ft. mxmtoon  
    "3951847031", --ZEROTWOOOOO     
    "2920078671", --Running in the 90s lol
    "1282381015", --Initial D- Deja vu
    "2846556179", --OOF lasanga!
    "2861490408"  --Lost A Part- lofi hiphop    
}

local muteButton = script.Parent.Parent.MuteButton
local skipAhead = script.Parent.Parent.FastForward
local skipButton = script.Parent.Parent.SkipButton
local currentSongDisplay = script.Parent.TextLabel
local musicPlayer = script.Parent.Music
local marketplaceService = game:GetService("MarketplaceService")


skipButton.Activated:Connect(function()
    musicPlayer.TimePosition = musicPlayer.TimeLength
end)

skipAhead.Activated:Connect(function()
    musicPlayer.TimePosition = musicPlayer.TimePosition + 15
end)

muteButton.Activated:Connect(function()
    if musicPlayer.IsPaused == false then
        musicPlayer:Pause()
        muteButton.Text = "Pause"
    else
        musicPlayer:Resume()
        muteButton.Text = "Resume"
    end
end)


while true do
    for count = 1, #songs do
        musicPlayer.SoundId = "rbxassetid://"..songs[count]
        songInfo = marketplaceService:GetProductInfo(songs[count])
        musicPlayer.Loaded:Wait()
        musicPlayer.TimePosition = 0
        musicPlayer:Play()
        currentSongDisplay.Text = "Now playing: "..songInfo.Name
        musicPlayer.Ended:Wait()
        currentSongDisplay.Text = "Loading next song..."
    end
end

The audio in studio work perfectly, aswell as the buttons. But as soon as the first song in game end, or i skip it, nothing plays at all, and i have to press the pause button. But doing so only restarts the first, and ONLY the first song. pls help.

0
omg i have the same problem Jakob_Cashy 79 — 4y

Answer this question