Sound plays on entire map

i made radio that plays sound on click. I wanted it to make sound only in the house area, not on full map. please help.

local TurnOn = script.Parent
local Click = Instance.new("ClickDetector",TurnOn)
Click.MouseClick:Connect(function(OnClick)
	TurnOn.Parent.Sound:Play()
	TurnOn.Parent.Sound.MaxDistance = 30
	TurnOn.Parent.Sound.EmitterSize = 5 -- decrease the emitter size (for earlier volume drop off)
end)

image

Try placing the sound in a particular part in the workspace, instead of the workspace / baseplate or something.

2 Likes

I can fix this. It’s because you are telling the sound to play before you change its maxdistance and emittersize.
try this:

local TurnOn = script.Parent
local Click = Instance.new("ClickDetector",TurnOn)
Click.MouseClick:Connect(function(OnClick)
	TurnOn.Parent.Sound.MaxDistance = 30
	TurnOn.Parent.Sound.EmitterSize = 5 -- decrease the emitter size (for earlier volume drop off)
    TurnOn:Play()
end)
2 Likes

“Sound” instances must either be placed inside a “Part” instance or an “Attachment” instance for them to be played within the vicinity of that part or attachment. Alternatively placing a “Sound” instance inside of the workspace directly, will cause the sound to be played across the entire map to every player.

1 Like