how to get a random integer in a list?

#pragma strict

var speed = new List.<int>([4,4,20,20,20,20,20,20,20,20,24,24]);

function Start () 
	index = speed[Random.Range(0,12)];

I get argument out of range

Public variables get their values from the inspector, not your code. Always use the length of the list or array, not hard-coded values, since you don’t know for sure how many elements are in the list.