--list some things you want to trigger failuresdr_sim_ITT_c = xp.getDataref("sim/flightmodel/engine/ENGN_ITT_c")-- Aqui buscas las DATAREF del motor que quieres que produzca el Fallo ( alta Temperatura, excesivo uso de N1 Mayor a 100 %, Baja presion de aceite, Baja Presion de combustible, Alta Temperatura de Aceite... en FIN --list what failure datarefs you want to faildr_sim_engine_fail1 = xp.getDataref("sim/operation/failures/rel_engfir1")function engineOverStress()--build a timer that begins when the limit is reached, but is destroyed if the limit is no longer reached before the timer goes offlocal timer_overStress = nillocal ITT = xp.getFloatV(dr_sim_ITT_c, 1, 2) --either of my engines in this case--start an argumentif ITT >600 then if (timer_overStress == nil) then timer_overStress = timer.newOneShot("failEngine", 15) --calls failEngine() in 15 seconds unless the pilot reduces ITT! endelseif ITT <600 then if (timer_overStress ~= nil) then timer.stop(timer_overStress) --stops the timer when pilot corrects his erroneous ways end endend------function failEngine()--the dirty work...xp.setInt(dr_sim_engine_fail1, 6) -- Mode 7 inoperative [6]--[[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]]]--end