Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

How to Lower Audio On Certain Points [closed]

Asked by 10 years ago

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?

Locked by adark and Articulating

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

3 answers

Log in to vote
3
Answered by
Merely 2122 Moderation Voter Community Moderator
10 years ago

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
0
Thanks, Merely, I'll try it out! Mirror_Master 25 — 10y
Ad
Log in to vote
2
Answered by
User#2 0
10 years ago

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.

0
How though? Mirror_Master 25 — 10y
0
Set Sound.Volume to a number? User#2 0 — 10y
0
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. Mirror_Master 25 — 10y
0
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. MrNicNac 855 — 10y
Log in to vote
1
Answered by 10 years ago

Maybe you could insert the sound into the person itself and make it local for everyone, so you change the one whom entered it.

0
How would I insert it into the player? Mirror_Master 25 — 10y