-- CHT limits. 250 deg C max 15 min if get(cht_1) > 250 then CHT_1_counter = CHT_1_counter + passed else CHT_1_counter = CHT_1_counter - passed end if get(cht_2) > 250 then CHT_2_counter = CHT_2_counter + passed else CHT_2_counter = CHT_2_counter - passed end if CHT_1_counter > 15 * 60 then CHT_1_counter = 30 cht_1_fail = true print("eng_1 out of CHT limit") end if CHT_2_counter > 15 * 60 then CHT_2_counter = 30 cht_2_fail = true print("eng_2 out of CHT limit") end if CHT_1_counter < 0 then CHT_1_counter = 0 cht_1_fail = false end if CHT_2_counter < 0 then CHT_2_counter = 0 cht_2_fail = false end-- Todas las fallas que queramos poner --Aqui hacemos que falle el motor-- final engine failure logic -- calculate failre if rpm_1_fail or cht_1_fail or in_oil_1_fail or out_oil_1_fail then left_eng_must_fail = true -- if at least one of parameters is fail else left_eng_must_fail = false end if rpm_2_fail or cht_2_fail or in_oil_2_fail or out_oil_2_fail then right_eng_must_fail = true -- if at least one of parameters is fail else right_eng_must_fail = false end -- set fail if it must fail or set work if all parameters are fine if left_eng_must_fail ~= left_eng_last then if left_eng_must_fail then set(left_eng_fail, 6) else set(left_eng_fail, 0) end end if right_eng_must_fail ~= right_eng_last then if right_eng_must_fail then set(right_eng_fail, 6) else set(right_eng_fail, 0) end endPor que set(right_eng_fail, 6) por que X plane tiene estos parámetros de Fallo The failure method used in X-Plane has 7 modes-1. always working [0 in lua]2. mean time until failure [1]3. exact time until failure [2]4. fail at exact speed KIAS [3]5. fail at exact altitude AGL [4]6. fail if CTRL f or JOY [5]7. inoperative [6]