@Lindon I don't see a need to use a global to create the note off (unless you need to turn if off in another script) just a reg variable should be fine. If you want 1 ID per note then use a MIDIList instead.
function onInit() { reg noteId; } function onNoteOn() { Message.ignoreEvent(true); noteId = Synth.playNote(Globals.triggerNote, Message.getVelocity()); Console.print("playing trigger note:" + Globals.triggerNote); } function onNoteOff() { Synth.noteOffByEventId(noteId); }Another option