So I have this two scripts, local and Server and connected by remote event fire server, I want to when I click the button, not only me , but people NEAR me can hear it, but people who’s far from can’t hear it, how can I do it?
This is my latest script
— Local Script
local event = game.ReplicatedStorage.SoundSys
local gun_sound = script.Parent.Sound1
Button.MouseButton1Click:Connect(function()
event:FireServer(gun_sound)
end)
— Server Script
local event = game.ReplicatedStorage.SoundSys
event.OnServerEvent:Connect(function(player, sound)
sound:Play()
end)
You could do this The sound must be parent in a part and require a server script to play the sound, if you use local script to play the sound, you will won’t hear it.
Set RollOffMaxDistance to any numbers you’d like to (Max distance the sound can be heard)
Set RollOffMinDistance to any numbers you’d like to (Min distance the sound can be heard)
For RollOffMode, i recommend you to set it to LinearSquare, which are the best sound setup in my option