DR1FTTR
(everett)
September 23, 2020, 9:05pm
#1
I made a music GUI, and I want to show the name of the song ID playing. say im using 12345. Im doing songName.Text = game.MarketplaceService:GetProductInfo(sound.SoundId).Name wich sound is = workspace.music.SoundID. It keeps saying Unable To Cast Instance To Int64. I need help please. Clearer code
local sound = game.Workspace.music
local songName = main:FindFirstChild(“SongName”)
songName.Text = game.MarketplaceService:GetProductInfo(sound.SoundId).Name
laurenbtd5
(laurenbtd6)
September 23, 2020, 9:08pm
#2
You forgot to add the InfoType Enum to :GetProductInfo(). Try this
local marketplaceservice = game:GetService("MarketplaceService")
songName.Text = marketplaceservice:GetProductInfo(sound.SoundId,Enum.InfoType.Asset).Name
DR1FTTR
(everett)
September 23, 2020, 9:10pm
#3
It still doesent work and says cant cast to int 64
DR1FTTR
(everett)
September 23, 2020, 9:14pm
#4
btw is his not working since this is in a local script?
laurenbtd5
(laurenbtd6)
September 23, 2020, 9:16pm
#5
No, it will work in a localscript. Try this instead
local marketplaceservice = game:GetService("MarketplaceService")
local songid = sound.SoundId:match("%d+")
songName.Text = marketplaceservice:GetProductInfo(songid,Enum.InfoType.Asset).Name
2 Likes