This is something I threw together last night (which means it not really polished, but it’s functional) for some extra enjoyment with my Cannons addon. Basically, it’s a system that plays calm music when not much is going on, and starts battle music when you fire your gun (clientside), or any other serverside events that are set to run the command “cl_music_startbattle” or “cl_music_startcalm” on players. For example, I set my cannon to start the battle music on any players within 1000 units when it shot.
Place the script in your base Lua folder. Next, go into your sounds folder and create a folder called “battle” and a folder called “calm.” Now you have to get the music you want to use. For example, I used the overworld and battle music from Morrowind. Put your MP3 music in the respective folders, and name the files “battle1,” “battle2,” “battle3,” etc. (replacing “battle” with “calm” when adding calm files, obviously). Now you’re ready to go.
Once in game, just type ‘lua_openscript_cl cl_music.lua’ in your console, and your music will begin to play. Now you can let it be, and the music will switch when needed.
If you want to change the volume of the music, use the command ‘cl_music_volume percent’
Report any bugs or whatever (there are a few, like battle music playing when switching from a lethal weapon). I can’t promise I’ll fix any though.
If you want to edit it, re-release it, or do whatever, feel free.