How do I make a music panel (the scripting)

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I want to make something like this, I can make the gui but I need help scripting it. I want to make something like this :

  2. What is the issue? The issue is the scripting side of things.

  3. What solutions have you tried so far? Looked it up on YT and devforums but could not find anything related.

If someone could help out or show me what code I need to use to make the buttons work then that will be appreciated! <3

Obviously do not tell me the whole script, also please explain the lines of the script you could provide to me if possible. I want to learn aswell.

hmm use MarketplaceService:GetProductInfo() to get the name and the uploader, and for the played by just use the player that send remote event request.

Could you explauin more briefly? I’m not very good at scripting.

so in a local script


local textbox = -- textbox path
local remote = -- Remote Event path
local confirmButton = -- confirm button path

local function RequestSong()
 local id = textbox.Text
 remote:FireServer(id)
end

confirmButton.Activated:Connect(function()
 RequestSong()
end)

In a server script in ServerScriptService

 local remote = -- path
 local SoundObject = -- path

local function playSong(player, songId)
 SoundObject.SoundId = "rbxassetsid://".. songId
end

remote.OnServerEvent:Connect(playSong)

the code might not be syntax free
also check the Playing property in sound object

? Uh please provide some more info xd ik am annoying lol

So you are looking to make a song queue system right?

I do suggest doing something like what @danthemanroblox192 , however i would add a check for the InfoType. This would check if it was an audio asset, this also prevents people from using backdoor audios inside of models (Which is super abundant).

For example:

local MarketPlaceService = game:GetService("MarketPlaceService")
local textbox = -- textbox path
local remote = -- Remote Event path
local confirmButton = -- confirm button path

local function RequestSong()
 
 local id = textbox.Text
 local Information = MarketPlaceService:GetProductInfo(id)
 if Information.InfoType == 4 then
 remote:FireServer(id,Information.Name)
 else 
 textbox.Text = "Invalid Id"
 end
end

–// inside server script

 local remote = -- path
 local SoundObject = -- path

local function playSong(player, songId)
 SoundObject.SoundId = "rbxassetsid://".. songId
end

remote.OnServerEvent:Connect(playSong)

(Did this very roughly, credits to @danthemanroblox192 , not sure if this will work)

2 Likes

Adding on to @Revelted and @danthemanroblox192

The script looks fine to me, test it out and let me know if you get any errors. I would also recommend putting the “Information.Name” , the arg into a variable and then passing it. Second thing I would recommend is double checking the InfoType in the server again.

Sorry for the late reply

Hope it helps :slight_smile:

WhAt I would do is fa remote sends the id over to the server, the server checks whatever you need and then checks it’s a real ID, then it puts it in a table queue system which your sound player will loop through.