In general, 10w40 oil is thicker than 10w30 oil at both cold and high temperatures. This means that 10w40 oil will provide better protection for your engine at high temperatures, but it may also make your engine run a little less efficiently at low temperatures. However, the differences between 10w40 and 10w30 oil are relatively minor, and either type of oil is suitable for use in a 1997 Chevy z71.
Ultimately, the best way to decide which oil to use in your vehicle is to consult your owner's manual. Your owner's manual will specify the recommended oil type and viscosity for your vehicle, and using the recommended oil will help to ensure that your engine performs at its best.