tModLoader How do you make a custom weapon use a custom sound?

gaetes

Skeletron
I'm making a content mod that adds in content from Team Fortress 2, and I have the stock pistol nearly done and functional. All I need is the pistol sound from TF2 to play whenever the gun is used, but I can't find any updated 1.4 tutorials on it, and any code I make from experimentation never works.
My current code is:

public override void OnConsumeAmmo(Item ammo, Player player)
{
string pistolshoot = "tf2content/Sounds/pistol_shoot";
SoundEngine.SoundPlayer.Play(SoundType.Sound.(pistolshoot));
}

The parentheses in front of the "pistolshoot" comes up with an error that says it expects an identifier, when I had already made one directly above it.
 
Your syntax isn't right, you should refer to the wiki here - basic sounds
 
Back
Top Bottom