I made this music player that works fine in studio but in the online game, it sometimes skips to a different song in the middle of another one that's playing, sometimes just stops in the middle of a song, or doesn't even play the songs at all. It is randomized and I am using a dictionary table in a module script.
local songList = require(game.ServerStorage.Songs)
local songTable = {}
for key, v in pairs(songList) do
table.insert(songTable, key)
end
local songSwitchEvent = game.ReplicatedStorage.SongSwitchEvent
while true do
wait(1)
local randomSong = songTable[math.random(#songTable)]
script.Parent.SoundId = "rbxassetid://"..randomSong
local musicName = songList[randomSong]
songSwitchEvent:FireAllClients(musicName)
script.Parent:Play()
script.Parent.Ended:Wait()
end

1 comment
Unfortunately I’m not too familiar with songs. I could check it out some time later but for checks try adding print statements too see if you can find what’s wrong. Sorry for not being any help right now. I’d you still need help don’t hesitate to contact me.