Trying to make a GUI that changes the text to be the name of the asset. IDs are set in a table and are looped around.
runserv.RenderStepped:Connect(function()
local sound = music.SoundId
local id = string.match(sound, '%d+')
local Asset = game:GetService("MarketplaceService"):GetProductInfo(id, Enum.InfoType.Asset)
--All the code above is just checking if the ID in the Sound have changed
local name = Asset.Name
text.Text = "Song Playing: " ..name
end)
You’re getting the id every frame which is too much and causes the error, maybe try checking every 10 seconds:
while task.wait(10) do
local sound = music.SoundId
local id = string.match(sound, '%d+')
local Asset = game:GetService("MarketplaceService"):GetProductInfo(id, Enum.InfoType.Asset)
--All the code above is just checking if the ID in the Sound have changed
local name = Asset.Name
text.Text = "Song Playing: " ..name
end