#How to change weapon sounds

1 messages · Page 1 of 1 (latest)

river dock
#

Alright, I’ll go check in rq now that I’m back home

#

If you'd like, see if you can create a soundscript for it to refer to. That might be it.

dull hornet
#

wats that

river dock
#

Place this in any .lua file in /lua/autorun

dull hornet
#

so i put them as seperate scripts

river dock
#

Yeah. The .qc file is only used to compile a model. It is not used ingame

#

Lua scripts are loaded alongside the game

dull hornet
#

can i see a example because the wiki isnt descriptive enough

river dock
#

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"
} )```
dull hornet
#

O

river dock
#

sound.Add( {} ) is a function call. It will add the table in {}, once a map starts loading since it's autorun

dull hornet
#

like this?

#
    { event 5004 4 "reload2chip" }
    { event 5004 23 "reload1chip" }
#

Thank you! it works now*

#

i like the random variation it has

#

btw the map is gm_mini