{"name":"terminate","title":"terminate","type":"command","url":"https://community.bistudio.com/wiki/terminate","revid":376945,"updated":"2025-12-31T22:54:37Z","groups":["Program Flow"],"status":"ok","games":{"ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofpe 1.00","arma3_since":"0.50","description":"Terminates (aborts) spawned or execVMed script.\n\n> [!IMPORTANT]\n> The given script will not terminate immediately upon terminate command execution, it will do so the next time the script is processed by the scheduler","syntaxes":[{"syntax":"terminate scriptHandle","params":[{"name":"scriptHandle","type":"Script Handle","type_expr":"Script Handle"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"unary","right":{"text":"scriptHandle"}},{"syntax":"terminate FSMHandle","since":"arma3 2.18","params":[{"name":"FSMHandle","type":"Number","description":"The FSM script must be launched with 'allowTermination' flag for this command to work (see execFSM).","type_expr":"Number"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"unary","right":{"text":"FSMHandle"}},{"syntax":"scriptHandle terminate result","since":"arma3 2.22","params":[{"name":"scriptHandle","type":"Script Handle","description":"Only \"Empty Handle\"'s can have their result set.","type_expr":"Script Handle"},{"name":"result","type":"Anything","description":"The result to write into the Promise","type_expr":"Anything"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"scriptHandle"},"right":{"text":"result"}}],"examples":[{"code":["_script = [] execVM \"script.sqf\";\nsleep 5;\nterminate _script;"]}],"see_also":["execVM","spawn","scriptDone","halt","execFSM"]}