How do I fix my Audio name display script

So, I tried this script first but it didn’t work. I don’t know what is the error here.

local mps = game:GetService("MarketplaceService")
local music = game.Workspace:WaitForChild("Sound")
local SongText = script.Parent.SongTitle

function updateMusic()
	local id = string.gsub(music.SoundId, "rbxassetid://", "")
	local success, info = pcall(mps.GetProductInfo, mps, id)
	if success then
		SongText.Text = info.Name
	end
end


updateMusic()

music:GetPropertyChangedSignal("SoundId"):Connect(updateMusic)

The script is located inside a SurfaceGui that is located inside ScreenGui.

1 Like

Sorry people. I kinda dum sometimes using a script I change the script into a Local Script then it worked.