new rand;rand = random(100); //0 - 100if(rand <= 49) //50% chance there will be under 49{ //do something}else if(rand >= 50) //50 and up - 50% chance there will be higher{ //do something else}