So i want to make a sound library (of all my ingame sounds) for my admin panel, But all attempts have failed. It is not cloning the placeholder TextButton.
Current script:
for _,v in pairs(workspace:GetDescendants()) do
if v:IsA("Sound") then
local clone = script.Parent.PlaceHolder:Clone()
local id = v.SoundId:match("%d+")
local info = game:GetService("MarketplaceService"):GetProductInfo(id, Enum.InfoType.Asset)
clone.Name = v.Name
clone.Text = info.Name
clone.MouseButton1Click:Connect(function()
game.ReplicatedStorage.RemoteEvents.Music:FireServer(id)
end)
task.wait()
end
end
You are using game:GetService("MarketplaceService"):GetProductInfo() in the local script, (which i believe requires rbxassetid:// to work properly) so it isn’t actually getting product info.
Can’t you just add id:match(%d+") to game.ReplicatedStorage.RemoteEvents.Music:FireServer(id) instead?