I have a problem with my sound playing when I use my prompt. I tried to make it so the sound comes out of a part, and the sound wont work when I press the prompt. There is no errors in the output? When I moved the sound to the prompt, It worked, but I’m sure you all know probably don’t want the knock to be heard by everyone on the map when htere like 40 miles away.
Any way here is my code and Explorer tab if you can help me:
You could possibly do this in a local script inside of StarterGui, that should work for making only the player hear the sound if the sound was inside the prompt. I’m not sure how to fix the sound not playing in another part but you could also have the sound in StarterGui.
local Object = workspace.Knock.KnockSoundSpawn.DoorKnockSound -- might be useful to add some WaitForChilds here to ensure the sound actually exists upon refrence
local Prox = workspace.Knock.EToKnock
Prox.Triggered:Connect(function()
Object:Play() -- assuming object is what you want to play, it's probably easier to just refrence it here and play it. it looked like you were using a ancestry path to get to it before, which didn't seem to be leading anywhere.
end)
If you don’t want the knock to be heard by everyone 40 miles away, Then there is a property which you can change to determine how far the sound can travel.
The higher the number, the longer distance the sound can travel.