Quote: "1. playing one of a random sound from a specific sound bank each time the left mouse button is clicked and 2. The sounds do not overlap each other. "
It should be something like this, thought. Do not touch sounds commands yet, and it is untested yet.
MySounds = {}
MySound1 = "gamecore\guns\modern\colt1911\My Gun Sounds\dryfire.wav"
MySound2 = "gamecore\guns\modern\colt1911\My Gun Sounds\Fire1.wav"
MySound3 = "gamecore\guns\modern\colt1911\My Gun Sounds\Fire2.wav"
MySound4 = "gamecore\guns\modern\colt1911\My Gun Sounds\Fire3.wav"
MySound5 = "gamecore\guns\modern\colt1911\My Gun Sounds\Fire4.wav"
Function playing_ramdom_init(e)
MySounds[1] = LoadGlobalSound ( MySound1, 1 )
MySounds[2] = LoadGlobalSound ( MySound2, 2 )
MySounds[3] = LoadGlobalSound ( MySound3, 3 )
MySounds[4] = LoadGlobalSound ( MySound4, 4 )
MySounds[5] = LoadGlobalSound ( MySound5, 5 )
end
Function playing_ramdom_main(e)
math.randomseed( os.time() )
index = math.random( #MySounds )
if GetGlobalSoundPlaying ( index ) == 0 then PlayGlobalSound ( index ) end
end
Ignore if you has to merge this with some weapon to get it playing yours sound instead of their own; or perhaps you've your own weapon model, with your own anims, so you can use it to fit yours needs.
Do you need mouse working to in the script?
Sorry man, not time now to right a most elaborate script.
hth
3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz
OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics