When writing a SWEP with a SoundTable field in the ["ready"] animation sequence, the sounds do not play for the client when in a multiplayer server. They will, however, play for other clients (i.e. you cannot hear yourself rack a slide when picking up a gun, but players around you can).
I believe this is an issue with how sound tables are played in sh_anim.lua.
Example Code
Taken from the Black Ops SWEP pack
SWEP.Animations = {
["ready"] = {
Source = "first_draw",
Time = 1.5,
LHIK = false,
LHIKIn = 1,
LHIKOut = 1,
SoundTable = {
{s = "ArcCW_BO1.AK_Charge", t = 20 / 35}
},
},
-- ["reload"], etc.
Steps to reproduce
Sounds working in single player
- Subscribe to ArcCW Base and ArcCW Black Ops Weapons Pack
- Click "Start New Game" on the main menu in Garry's Mod
- In the top right, select "Single Player" from the drop-down
- Click "Start Game"
- Give yourself any ArcCW weapon from the spawn menu
ready sounds will play when given a weapon in the single player game
Sounds not working in multiplayer
- Click "Start New Game" again
- In the top right, select "2 players" from the drop down
- Select "local server"
- Click "Start Game"
- Give yourself any ArcCW weapon from the spawn menu
ready sounds will not play when given a weapon in the multiplayer server
When writing a SWEP with a
SoundTablefield in the["ready"]animation sequence, the sounds do not play for the client when in a multiplayer server. They will, however, play for other clients (i.e. you cannot hear yourself rack a slide when picking up a gun, but players around you can).I believe this is an issue with how sound tables are played in
sh_anim.lua.Example Code
Taken from the Black Ops SWEP pack
Steps to reproduce
Sounds working in single player
readysounds will play when given a weapon in the single player gameSounds not working in multiplayer
readysounds will not play when given a weapon in the multiplayer server