I don't understand why it doesn't work
s = game.Workspace.KeepGrouped.Sound -- Where sound is located. Don't change unless you know what you are doing.
s:Play() -- Plays the sound
function onKeyPress(actionName, userInputState, inputObject)
if userInputState == Enum.UserInputState.Begin then
s.Volume=0.9 -- Volume after waited for time in brackets
wait (.3) -- Time before volume change
s.Volume=0.8 -- Volume after waited for time in brackets
wait (.2) -- Time before volume change
s.Volume=0.7 -- Volume after waited for time in brackets
wait (.3) -- Time before volume change
s.Volume=0.6 -- Volume after waited for time in brackets
wait (.2) -- Time before volume change
s.Volume=0.5 -- Volume after waited for time in brackets
wait (.2) -- Time before volume change
s.Volume=0.4 -- Volume after waited for time in brackets
wait (.3) -- Time before volume change
s.Volume=0.3 -- Volume after waited for time in brackets
wait (.2) -- Time before volume change
s.Volume=0.2 -- Volume after waited for time in brackets
wait (.3) -- Time before volume change
s.Volume=0.1 -- Volume after waited for time in brackets
wait (.2) -- Time before volume change
s.Volume=0 -- Sound is silent
s:Stop() -- Stops music
end
end
game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.E)

5 comments
Remove the parameters of your onKeyPress function, and the if statement. The function will only run if the player presses E, so the if statement is not needed.
@Above But I want it to stop when i press E
Is there any output? Also, if this is a localscript, then you might want to address the mouse and use the KeyDown event instead of the ContextActionService
@lightpower No! KeyDown is deprecated! ContextActionService and UserInputService are the only things people should be using
Try removing the space between the bracket and wait so like this : wait() instead of wait (), also I reccomend using a for loop instead of manually changing it again and again, hope this helped!