I'm trying to develop a goal type game (Fps), Swat type, and i need a script where when you press J It plays the sound (Like SwatTalking.mp3) So the person says "Police on the floor!", Could someone please provide me with a script?, So basicly on input the talking plays.
And if possible, I have 4 voices saying different things, 'Police on the floor' 'Hands up!' 'Police!' 'Get down!' things like that, i need it that everytime you press J It plays one of them, so not in order, just random one every time you press the button,
I hope someone can provide me with a script,
A little search would have easily given you the results, but nevermind. I am in a good mood. :)
First and foremost the easiest is to have an array of audio files and play them one of them randomly when you press the J key.
It should work. I may have spelled length wrong, but the compiler should tell you if I did.
That is properly more or less the basics of randomly choosing a file from an array.
answered Oct 11 '11 at 12:08 PM