I finished a script that plays a sound when a button is pressed but it destroys everyone's ears where ever they are in the map.
Here is the script i'm using
function onKeyPress(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.E then end if IsEquipped == true and inputObject.KeyCode == Enum.KeyCode.E then game.Workspace.Sound:Play() end end game:GetService("UserInputService").InputBegan:connect(onKeyPress) function onKeyPress(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.E then end if IsEquipped == true and inputObject.KeyCode == Enum.KeyCode.E then game.Workspace.Sound:Stop() end end game:GetService("UserInputService").InputEnded:connect(onKeyPress)
If you could show me how to make it play from the person and how to make it get more quiet as you move farther away that would be great.