I have a Part
which has a Sound
item in it, as well as a Script
that runs the Sound
item. I have a movie theater that plays videos on the screen and 4 speakers per auditorium. I'd like to know how I can prevent all the audio in the game from overlapping each other.
So is there a way to set the range of audio (Kind of like setting the range of a light)?
Since this is not a request site I will just tell you how to do it, but not give you the script. The way I know would work is if you have a script in the speaker that checks if players are within the max distance to be able to hear it using magnitude. If the player is within the distance it should check if the player already has the sound in his PlayerGui, if not then it should create the sound and play it at the same time position as the main sound (you will have to set the volume to 0, put it in workspace and play it). If you attempt to do this and it doesn't work, create another post but with your attempt and I will help you out. Please vote up and accept as answer if this helps!
This is the final result that works for me!
wait(3) --Wait for the game to load, increase on slower computers (or find other fix) local player = script.Parent.Parent.Parent.Character.Torso screen = game.Workspace.Screen2 while true do if (screen.Position - player.Position).magnitude > 105 then --105 bricks away script.Parent.Audio2.P1.Volume = 0 --Mute script.Parent.Audio2.P2.Volume = 0 else script.Parent.Audio2.P1.Volume = 0.25 --Otherwise volume 25% script.Parent.Audio2.P2.Volume = 0.25 end wait() end