Random sounds on awake

Hi I’m making a multiplayer game and im trying to make it when you throw of a grenade, it will play a different sound on each throw, but the script I’m using plays both on the same throw, can some one help me?

Hmm, well that sounds easy. Just make an array, built-in array is best for this purpose, assign the clips to it, and then randomly play one of them on awake. Don’t forget to add an audio component to the grenade, just one, without any audio selected in it is fine.

Here’s an example, not tested:

var sounds : AudioClip[]; //Assign the sounds through inspector

function Awake()
 //get one at random from 0 to your array length (depends on how much sounds you have)
 audio.clip = sounds[Random.Range(0,sounds.Length)];