I've got a basic on death trigger running (for things like suicide bombers and blowing up when killed), and it runs perfectly when it's called in the init.sqf file, but when I try to run it in an initialization box for a unit or trigger or what have you, it doesn't work.
This is the script (i've just started this stuff so it's kind of poorly put together but it works):
_handle = player execVM "handle.sqf"; waitUntil {ScriptDone _handle}; _boom = "Bo_GBU12_LGB" createVehicle getPOS suicideBomber;
handle.sqf is
waitUntil {not alive suicideBomber};
When I run it in a box it just spawns a bomb immediately. It also only runs once even when in a while loop that should keep it running, but that's another problem.
Are there limitations on the kinds of calls and functions that work in the init boxes, and is there a work around for this? Also, what would be a better way than waitUntil, seeing as how that would bar other code from running, i would assume.