Say I have wind noise in my game and once I enter a house, I want the wind noise sound to lower but not be completely removed? How?
How to Lower Audio On Certain Points
3 answers
You will need to create local sounds for this to work.
Instead of putting your sound object in the Workspace, you need to place your sound object inside the current player's PlayerGui. Then when it is played, only that player will be able to hear it. Your localscript will then be able to change the volume based on whether or not the user is in the house.
Here's a quick example of a LocalScript you could place in the StarterGui.
local player = game.Players.LocalPlayer
local windSound = Instance.new("Sound")
windSound.SoundId = "http://www.roblox.com/asset?id=138161364"
windSound.Looped = true
windSound.Parent = player.PlayerGui
windSound:Play()
--now you need to change windSound.Volume when the character enters or leaves the house
Sounds have a Volume property. So when you detect the user is in the house you just lower the sound's volume, or even tween it.
4 comments
How though?
Set Sound.Volume to a number?
Yeah when ever I lower that, it lowers the entire sound of all the wind through the whole game. I need it to lower once they enter the house.
Thought about simply using Region3 to calculate if a character is "in" the house zone? Or maybe it could be as simple as having a part with a Touched event connected to it so you can change the sound when they "touch" the carpet or something.
Maybe you could insert the sound into the person itself and make it local for everyone, so you change the one whom entered it.
1 comment
How would I insert it into the player?
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thanks, Merely, I'll try it out!