Heya!
So Im making a Trello Music System and I keep receiving this error:
I have tried multiple things and cant seem to find a fix, its driving me insane!
Here is the code within the error:
while wait() do
SongNum = SongNum+1
local RawSong = Songs[SongNum]
local Song = "http://www.roblox.com/asset/?id="..Songs[SongNum]
if Song ~= LastSong then
game:GetService("ContentProvider"):Preload(Song)
local Sound = Instance.new("Sound", game.Workspace)
Sound.Volume = 1
Sound.SoundId = Song
Sound:Play()
game.ReplicatedStorage.Events.SongChanged:FireAllClients(game:service('MarketplaceService'):GetProductInfo(tonumber(RawSong)).Name)
wait(120)
Sound:Stop()
wait()
Sound:remove()
NotPlaying = false
else
NotPlaying = false
end
end

1 comment
The problem is likely occuring on line 4 (of the code you posted). Make sure
SongNumis a valid key of the tableSongsbefore concatenating.