#How to change weapon sounds
1 messages · Page 1 of 1 (latest)
If you'd like, see if you can create a soundscript for it to refer to. That might be it.
Creates a sound script. It can also override sounds, which seems to only work when set on the server.
wats that
Place this in any .lua file in /lua/autorun
so i put them as seperate scripts
Yeah. The .qc file is only used to compile a model. It is not used ingame
Lua scripts are loaded alongside the game
can i see a example because the wiki isnt descriptive enough
So if you use { event 5004 4 "My.Soundscript.Name" } in your qc's $sequence, compile your model, then just make a new text file in the autorun folder and rename it to anything.lua
The contents of the lua file may be as follows:
sound.Add( {
name = "My.Soundscript.Name",
channel = CHAN_WEAPON,
volume = 1.0,
level = 80,
pitch = {95, 110},
sound = "phx/explode03.wav"
} )```
O
sound.Add( {} ) is a function call. It will add the table in {}, once a map starts loading since it's autorun