Toggle custom hitsound

alias "ding" "ding1"
alias "ding1" "tf_dingaling_wav_override player.hitbeep; echo ***custom hitsound disabled***; alias ding ding2"
alias "ding2" "tf_dingaling_wav_override "quake3.wav"; echo ***custom hitsound enabled***; alias ding ding1"
bind "f10" "ding"
ding2

Ok, I have seen scripts to toggle the hitsound on and off, but not one to change from custom to normal. If you have gotten used to using a custom hitsound like I have, losing it to a sv_pure enabled server can be annoying! The bad part is that it is just silent, it doesn't revert to the default hitsound! So, this script will toggle you between the default hitsound and your custom one! Just replace quake3.wav with the name (or filepath, if it is not in the default tf/sounds folder) of your custom hitsound. Also, you can change F10 to whatever key you wish to use. Just stick in your autoexec.cfg and you are good to go!

Oh noes! You're not a Member!

Want access to cool stuff? As a member you can:

  • Post. Give the submitter your thoughts on this Script.
  • Say Thanks. Show your appreciation by sending the submitter points.
  • Stamp Posts. Let other posters know what you think of their posts.
  • Rate. Give this Script a rating out of 10.
  • Flag. Alert moderators and warn members of a problem with this Script.
  • Vote. Vote the submitter for the Monthly Awards.
  • Subscribe. Get notified when this submitter submits again.

Interested? Register or Login

Comments

  • SomeGuy avatar
    SomeGuy
    Availability
    Offline
    Points Level
    Beggar Points Level icon
    Beggar
    184 points
    Account Age Level
    Veteran Age Level icon
    Veteran
    4 years old
    Clearance Level
    Member Clearance Level icon
    Member
    • Report icon
    4 years ago:

    did a little tinkering with the sample rate and output bit depth, and it eventually worked! thanks!

    Why is butterscotch?
  • ChIck3n avatar
    ChIck3n
    Availability
    Offline
    Account Age Level
    Veteran Age Level icon
    Veteran
    4 years old
    Clearance Level
    Member Clearance Level icon
    Member
    • Report icon
    4 years ago:

    Ah yes. The source engine gets picky sometimes about the sample rate. You can either try to find the sound online already converted (either here or just google tf2 hitsounds), or convert it yourself. I use dbpoweramp, but you can probably use whatever audio program you know best. My current hitsound has 22KHz sample rate, and if that doesn't work try the HLDJ settings (11KHz, 16bit, and mono channel). Just play around with the converter a bit and let me know if it still doesn't work.

    Bananite
  • SomeGuy avatar
    SomeGuy
    Availability
    Offline
    Points Level
    Beggar Points Level icon
    Beggar
    184 points
    Account Age Level
    Veteran Age Level icon
    Veteran
    4 years old
    Clearance Level
    Member Clearance Level icon
    Member
    • Report icon
    4 years ago:

    The option is on, and it is a WAV file. Here is what the console says when the sound should play: Invalid sample rate (32000) for sound 'message3.wav'

    Why is butterscotch?
  • ChIck3n avatar
    ChIck3n
    Availability
    Offline
    Account Age Level
    Veteran Age Level icon
    Veteran
    4 years old
    Clearance Level
    Member Clearance Level icon
    Member
    • Report icon
    4 years ago:

    Hmmm, do you have it enabled (eg. can you hear the default sound?)? Try entering tf_dingalingaling "1" in the console to make sure it is enabled. If it toggles between the normal sound and silence (and still prints the enabled/disabled in console), then it may be your sound file. Is it in .wav format? I don't think mp3s or other filetypes will work. If you could post some of what your console is saying when it doesn't work, that would help a lot.

    Bananite
  • SomeGuy avatar
    SomeGuy
    Availability
    Offline
    Points Level
    Beggar Points Level icon
    Beggar
    184 points
    Account Age Level
    Veteran Age Level icon
    Veteran
    4 years old
    Clearance Level
    Member Clearance Level icon
    Member
    • Report icon
    4 years ago:

    I put my sound in the TF/sound file, changed the filename in the script, and yet it still won't work in any server, including ones I make. while I can switch between sounds, the new one still won't work. help?

    Why is butterscotch?

Credits

Key Authors
ChIck3n
creator

Submitter

ChIck3n avatar
ChIck3n
Availability
Offline
Account Age Level
Veteran Age Level icon
Veteran
4 years old
Clearance Level
Member Clearance Level icon
Member

ChIck3n
(Creator/Co-creator)

Rating

?/10
Not yet rated.

Stats

Post Count
5
ViewCount
3,799
Date Added
4 years ago
Date Modified
4 years ago

License

N/A

Share

Code to use:

More embeddable images

Bookmark and Share