How can I adjust sound volume to different things in a gui?

Hi, I’m making a gui for my game that allows the client to control sounds volumes individually acording to what they are classified as (for example, “ambient” sounds are things like waterfalls, wind or weather sounds, etc. while “music” are the songs that are played in the background according to where I am located in the workspace. Some players might want to reduce the music volume to hear better the ambient or something). However, I don’t really know how can I do that without changing everyone’s volume in the attempt, or just having scripts that don’t even run or work properly.

Accessibility – Best Practices (roblox.com) At the end of this guide there’s a video that shows kinda what I’m talking about. I just want ideas on how can I do that lol.

1 Like

Try this code:

  1. – create a sound
  2. local sound = Instance.new(“Sound”, game.Workspace)
  3. sound.SoundId = “rbxassetid://301964312”
  4. sound.Looped = true
  5. sound.PlaybackSpeed = 2
  • – make the sound loud
  1. sound.Volume = 2
  • – play the sound
  1. sound:Play()
  • wait(7)
  • – make the sound quiet
  1. sound.Volume = 0.2