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

Club Music Gui Not Changing The Text When The Song Is Changed?

Asked by
LuaDLL 253 Moderation Voter
5 years ago
--/ Variables
local MusicTopBar = script.Parent.MusicTopBar
local Progress = MusicTopBar.Progress
local Bar = Progress.Bar
local SongName = MusicTopBar.SongName
local SongUploader = MusicTopBar.SongUploader

local SongNameText = "Song: "
local SongUploaderText = "Uploaded By: "

local MarketplaceService = game:GetService("MarketplaceService")

local SoundService = game:GetService("SoundService")
local Music = SoundService:WaitForChild("Music")

local MusicInfo = {
    MusicName = "",
    MusicUploader = "",
}

--/ Functions
function SetGuiText()
    SongName.Text = SongNameText..MusicInfo.MusicName
    SongUploader.Text = SongUploaderText..MusicInfo.MusicUploader
end

Music.Changed:Connect(function()
    if Music.SoundId ~= nil and Music.Playing then
        local Info = MarketplaceService:GetProductInfo(string.sub(Music.SoundId,13,30),Enum.InfoType.Product)
        MusicInfo.MusicName = Info.Name
        MusicInfo.MusicUploader = Info.Creator.Name
        SetGuiText()
    end

end)

Doesn't Print Any Errors

0
You using a Script or LocalScript? yHasteeD 1819 — 5y
0
On line 29, try changing Enum.InfoType.Product to Enum.InfoType.Asset, or just leave the second parameter blank since it defaults to it. I think Product is for developer products while Asset is for...well, assets. User#20279 0 — 5y

Answer this question