Server-side Music System

I’d like to make a server-sided music system with a request a song and mute the song buttons. I currently have a server-sided music system however I am not too sure on how to make the mute button on the local side, and I am not sure how to let customers be able to request songs and let HR+ skip songs. Are there any tutorials out there that I could possibly learn from?

1 Like

Pause

local SoundService = game:GetService("SoundService")

local Button = script.Parent
local Music = SoundService.Sound

Button.MouseButton1Click:Connect(function()
	Music.Playing = not Music.Playing
end)

or

Will leave the music playing but the player will not be able to hear it

local SoundService = game:GetService("SoundService")

local Button = script.Parent
local Music = SoundService.Sound

Button.MouseButton1Click:Connect(function()
	if Music.Volume == 0.5 --[[ normal volume ]] then
		Music.Volume = 0
	elseif Music.Volume == 0 then
		Music.Volume = 0.5 --normal volume
	end
end)
1 Like

You just showed how to play a sound. This helps in no way.

OP: You want to have a textbox where the client can input a song ID. This fires a remote event to the server and adds it to a table. This table keeps track of all songs currently in queue. You can have a loop going through this table to remove finished songs and play the next one.

4 Likes

She said she’s not too sure on how to make a mute button
I’m just trying to help in one part :derp:

1 Like

Any sound played on the server will replicate to the server. So, muting the sound on the client-side will only mute it for that player.

For the request song, I suggest you look into Remote Events.

For the skip song, that’s up to you now. Just remember to do the skip and request the song on the server and mute on local/client side.

You would create an admin-like system to record which HR+ can do skipping, if this is based on rank, you would use player API, specifically :GetRankInGroup which returns a number from 0 (not in group) to 255.

To request a song you would use Remote events which take a client-side request and then place it into a queue or however you want it.

I am unfamiliar with SoundService or SoundGroups so my approach is to just fire all clients to create the music for them then when a new audio needs to play, you would just fire all clients to play a new audio ID you gave them. This way, if they want to mute the song, they can do so locally which will be easier for the server. (Just using Sound instance)