Right, I've reworked a script I've had for ages (I think made by Tzap) into playing any one of three sound effects (or one of silence) when the player reloads the weapon... sort of.
:state=0,scancodekeypressed=19:etimerstart,state=1,localvar=1,setvar=0
:state=1,etimergreater=100:state=2
:state=1,random=1:localvar=1,incvar=1
:state=1:localvar=1
:state=1,varequal=5:setvar=0
:state=2:localvar=1
:state=2,varequal=4:plrsound=audiobank\user\downing\reload.wav,state=0
:state=2,varequal=3:plrsound=audiobank\user\downing\reload2.wav,state=0
:state=2,varequal=2:plrsound=audiobank\user\downing\reload3.wav,state=0
:state=2,varequal=1:plrsound=audiobank\user\downing\reload4.wav,state=0
:state=2,varequal=0:state=0
It works quite well in the sense that the player says the corny one-liner when reloading (initiated by pressing 'r'), but it doesn't work in that the player says it even when the player presses 'r' and the gun doesn't reload.
I know there's not any condition currently in the code for asking if the player is reloading (although it would help) or even if the ammo is at 0. Can anyone think of a way of getting round this that I can't?
Thanks.
[center]