|
Hello, 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, Thank you
(comments are locked)
|
|
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. Good luck! Whoops, doublepost...
Oct 11 '11 at 12:43 PM
syclamoth
Yeah I know. Is that a bug? Because I swear I did not press that button twice. But I cannot delete it because of some bug on UA I guess.
Oct 11 '11 at 12:52 PM
Arbiter
I deleted the duplicated answer. It happened to me a few times too... but at least in my case it wasn't a UA bug - it was a bug of mine!
Oct 11 '11 at 12:56 PM
aldonaletto
Works Great!, Thank you!
Oct 14 '11 at 05:38 AM
dehan
(comments are locked)
|

Dude, never say "someone give me a script" in UA - most guys here become infuriated with these (bad) magic words! You're lucky today: @OrangeLightning is in a good mood and provided it without complain (so good that he posted the answer twice!)
But in the future, ask for it in a more generic way, like "could anyone point me the right direction?" - you'll probably receive the script anyway, but without some furious guys downvoting you and eating your reputation.
Sorry, i'm new here.