How can I modify Audio Using PlayLocalSound

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I wanna play a local sound!

  2. **What is the issue?**Its tooo loud,When I modify the volume property it did not lower ther volume

3.Ive lower the volume in roblox to 1 bar,Set the volume of the sound to 0.25,Reduce my Audio loudness of the PC to 3 bar out of 16(mac) And all these at once,Still its too loud and i cant use other audio

So Ive gotten a Nuke sound,Ive set it’s volume to like 0.25,but when i test,Its still as loud even if I lower the volume.So how can i do this with Play Local Sound

1 Like

Can you provide the code and sound location so we can futher assist you

1 Like

Maybe try set volume to lower amount? And why are you using PlayLocalSound?

Ive Already lower the volume amount,And im using play local sound because,Im making a nuke game,And sound don’t travel instantly do they?.So If Each Player is at a different distance from the blast,It should play sound accordingly,so that the player that’s closest will hear first,And i cant use normal sound since If I use Normal sound,The range need to be big,Because player may zoom out,And If the range is big,Then other player may here it before The shockwave even reach them,So Can you tell me how to lower the volume in PlayLocalSound??Since Lowering the volume of a sound object does not effect the volume in testing.

I dont think so, maybe in real life but not in Roblox. Also you don’t need to use PlayLocalSound. It is function that is commonly used by plugins to play sound in studio, its not an object.

To make everyone hear the sound (at the same time and at any distance) you can just put sound in SoundService for example and then play it. If you put sound into BasePart or Attachment it will be a 3D sound, so you can ajust some properties like RollOffMaxDistance and RollOffMinDistance to make so the only people who are within this distance can hear the sound.

Really? Then set sound’s volume to 0 and check again :wink:. If sound is still playing then look your scripts and check if there is no code that sets sound’s volume.

Im making a script that make sound travel NOT instantly,And The Roll max distance wont work since If it too small,maybe player is zooming out so they dont hear it,If its too large,Other player can hear even though the nuke sound haven’t reach.

To be clear,I want the sound To play at different time depending by the distance,For Different player eg the one which is 300 m from 0,0,0 will hear after 1 second,But The one 3000m from 0,0,0 will hear after 10 sec,which ive sucessfully accomplish.But PlayLocalSound Don’t mind the volume,And for me,Its Stupidly Loud,So I am wondering HOW to lower sound volume while using PlayLocalSound

(by the way my volume of mac is like 3/16 and in roblox 1/10 and its still almost 120 decibel,While the sound is not that loud,eg ive set the volume to 0.2 which make it 70 decibel,THE play local sound thinks the volume is 1)
And There’s no set volume script anywhere

You could use a localscript to play the sound on the client.

I am using a local script and a Remote Event

You can use :Play() on the sound instance on client (no need for PlayLocalSound)

Ok. This script shoul be a local script placed inside StarterGui , StarterCharacterScripts or StarterPlayerScripts:

local Players = gme:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local soundPart = workspace:WaitForChild("Part") -- Insert path to your part (nuke)
local sound = soundPart:WaitForChild("Sound") -- Insert path to your sound here
local remote = ReplicatedStorage:WaitForChild("PlayNukeSound") -- Insert path to your remote event here

local player = Players.LocalPlayer

remote.OnClientEvent:Connect(function()
   if player and player.Character then
       local distance = player:DistanceFromCharacter(soundPart)
       local waitTime = distance/300 -- If player is 3000 studs away from nuke he will hear sound after 10 seconds
       task.wait(waitTime)
       sound:Play()
    end
end)

Then from your server script that launches nuke you should white this somewhere:

local ReplicatedStorage = game:GetServise("ReplicatedStorage")
local remote = ReplicatedStorage.PlayNukeSound

remote:FireAllClients()

Also stop talking about PlayLocalSound because you don’t need it.

1 Like

Ok But He already helped me figure it out,Insead of play local sound,I’ll will use Play() on client

Yes, but do you have script that plays sound based on distance?

Yes,Ive use Distance and also turn roblox stud into meter

1 Like