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

Sound broadcasting across entire map?

Asked by 7 years ago
Edited 7 years ago

I have a Sound inside of a model which can be toggled on and off via Gui/RemoteEvent. A button is pressed, firing the event and causing my server script to play the audio. It plays, no problem, except that the entire map can hear it. I want only those close to it to hear it as it's a siren and it's awfully annoying to hear it constantly no matter where you are. I messed with MaxDistance, MinDistance, EmitterSize, etc. to no avail. If anyone has any suggestions, please do tell.

Tiny snippet of code pertinent to the Sound:

    player.Character.Car.Siren.MaxDistance = 10
    player.Character.Car.Siren:Play()

3 answers

Log in to vote
2
Answered by
Perci1 4988 Trusted Moderation Voter Community Moderator
7 years ago
Edited 7 years ago

You guys are over-complicating this lol. All you have to do is put the sound in a Part, then it will automatically emit its sound from that part. It even includes a Doppler effect.

Wiki is love, wiki is life.

0
Doppler effect implementation is pretty cool, didn't know that existed. P100D 590 — 7y
Ad
Log in to vote
0
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
7 years ago

Roblox is pretty bad at doing audio w/ range.

The way i've always went around this problem is to create a Folder inside of StarterGui, and play all Sounds from there, calculating the volume using magnitude.

Log in to vote
0
Answered by 7 years ago

If you want to create a 3D sound that only one person can hear, you can create a part, clone the sound to it, place it under the player's camera, change its position. Then play the sound!

Answer this question