The length of the sides of a triangle are x, 2x+2, and 13. If the perimeter of the triangle is 30, what is the value of x?