I am making this weapon, and the reload function ( for the model ) uses 6 different sounds. How would I play all of the sounds for the weapon at the right time? Or would this be a script thing ( scripts/weapons/*name* ) Either way I don't know how. Can someone who knows how help me?
I usually just pop open Audacity and edit them all together. It takes a bit longer but it sounds better.
[QUOTE=Chad Mobile;20346935]I usually just pop open Audacity and edit them all together. It takes a bit longer but it sounds better.[/QUOTE]
Ok, I might try that. Is Audacity free?
Yes, it is :cool:
Or if you're lazy, you can just do this:
[lua]
local sounds = {
Sound("reload1.wav"),
Sound("reload2.wav"),
}
function SWEP:ReloadSounds(index)
self:EmitSound( sounds[index] )
timer.Simple( SoundDuration(sounds[index]), self:ReloadSounds( index + 1 ) )
end
[/lua]
Pass the index of the sound you want to start at as the first argument.
Meh, for CS:S skins that come with a billion sounds and a script file I just Audacity them together :v:
Never tried doing that. Thanks.
:v:
OK, so how do I play a sound when I reload? Do I just add self.Weapon:EmitSound in the reload function?
That's what I do usually, but here is what I've been using for ages:
[lua]
function SWEP:Reload()
if self:Ammo1() > 0 and self.Weapon:Clip1() < self.Primary.ClipSize then
self.Weapon:DefaultReload(ACT_VM_RELOAD);
self.Weapon:EmitSound("your/good/sound.wav")
end
end
[/lua]
Cheers :cheers:
Works perfectly. Thanks.
No problem :razz:
Chad = lifesaver
thank you very much :D
Sorry, you need to Log In to post a reply to this thread.