So I’m trying to make a feature where you can make your own playlist for a couple of robux (19 robux). But I’m a bit confused on how to do this. Here’s my script (local).
local MusicQueue = script.MusicQueue
local IDText = script.Parent.IDText
local MusicList = script.Parent.MusicList
local MarketplaceService = game:GetService("MarketplaceService")
local Music = {}
local CloneQueue = 0
IDText.FocusLost:Connect(function(enterPressed)
if enterPressed == true then
CloneQueue += 1
local ID = IDText.Text
local Clone = MusicQueue:Clone()
local Name = nil
Clone.AssignedCloneValue.Value = CloneQueue
if not (MarketplaceService:GetProductInfo(ID).Name) then
return
else
Name = MarketplaceService:GetProductInfo(ID).Name
end
Clone.Name = CloneQueue
table.insert(Music, Clone)
Clone.MusicName.Text = Name
Clone.Parent = MusicList.UIListHandle
print(Music)
Clone.RemoveButton.MouseButton1Click:Connect(function()
local AssignedCloneQueue = Clone.AssignedCloneValue
Clone:Destroy()
table.remove(Music,AssignedCloneQueue.Value)
CloneQueue -= 1
print(Music)
end)
end
end)