So I made this script for my battlefield that makes explosions happen every few seconds, and a sound plays when an explosion goes off. I set the MaxDistance to 250 so you can only hear it if you're close to it, but it doesn't seem like it changes anything and I can hear it at the same volume from the same distance. The sound in Workspace has a MaxDistance of 250, and I also put it as part of the script to make sure it's that number but I can still hear it anywhere. Here's the script below.
Sound = game.Workspace.BlowUpSound
function BlowUp()
local Explosion1 = Instance.new("Explosion",workspace)
Explosion1.Name = "Bomb1"
Explosion1.Position = Vector3.new(-56, 43.1, 9.8)
Explosion1.BlastRadius = 2
Explosion1.BlastRadius = 13.8
Explosion1.DestroyJointRadiusPercent = .5
Explosion1.ExplosionType = "NoCraters"
end
repeat
wait(10)
BlowUp()
Sound.MaxDistance = 250
Sound:Play()
until script.Disabled == true

5 comments
Forgot to add I'm new to scripting and this is probably a noob-ish question lol
If the sound isn’t parented to a basepart or attachment, the sound is considered global and MaxDist won’t effect it, as far as volume is concerned.
Ah I see. I'll try to fix that now.
It worked! Thanks for the help.
Np, Glad it worked.