tModLoader How to weapons use custom sounds

Skaterboyjt97

Terrarian
How would i make a weapon use a custom sound? I have the .wav id like to use, Do i need a .cs for the sound file in the sound folder? And what weapon code would i need to make it play the sound?
 
item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/Wooo");
assuming the wav is in that folder, names Wooo.

Don't need a .cs file for the sound[/QUOTE
Trying this now! Thank you so much...
[doublepost=1484019592,1484019412][/doublepost]I have a question, is there a way to make a sound play whenever you pull out a weapon?
 
How would i make a weapon use a custom sound? I have the .wav id like to use, Do i need a .cs for the sound file in the sound folder? And what weapon code would i need to make it play the sound?
Where do I put the sound name? I have the sound in the folder, everything else works, but when i use the item, i dont hear the sound
 
Setting the use sound of an item works for me, but setting the sound of a projectile (of a spinner type weapon) won't work. The line I found to set play a sound worked fine, but when trying to use a custom sound I couldn't get it to work.
Code:
                Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 15);
 
Back
Top Bottom