Sound is not playing

Hello,

I want to play a sound globally but with a maxdistance.
When I typed “Sound.MaxDistance” “MaxDistance” was crossed out in the autocomplete, but I could still click it (its not red-underlined or anything)
I couldn’t see an error.

Script:

local Sound = script.Parent.Parent.Register1.Particle.Sound
	Sound.MaxDistance = 15
	Sound:Play()
	Sound.Ended:Wait()
	Sound:Stop()

I also tried this (doesn’t work)

local Sound = script.Parent.Parent.Register1.Particle.Sound
	Sound.RollOffMode = Enum.RollOffMode.Linear
	Sound.RollOffMaxDistance = 15
	Sound:Play()
	Sound.Ended:Wait()
	Sound:Stop()

It’s a ServerScript.

Try using RollOffMaxDistance instead of MaxDistance

Only thing I can think of is making sure the sound is a direct child of a part, meaning that if “Particle” is a ParticleEmitter, I do not think this will work, and you’ll have to move the Sound to an actual 3D part in order for MaxDistance to work properly.

2 Likes

“Particle” is a part so this cant be the issue :confused: And wdym by 3D Part, its a normal Basepart.

I did that in my second try, it didnt work.

Are you sure the Sound you are using isn’t moderated?

Try playing the sound normally so we can see if it’ll play at all.

Weird… Mind sending a screenshot of your workspace (explorer tab)? (showing the parent of the sound)

Yes, it does play. So that wont be the issue.

Try changing the max roll off value to 200, and play the sound then.