I'm trying to what you suggested, but I am still having issues with the keydown repeating. Maybe showing exactly what I'm doing will shine more light on my problem.
PHP Code:
//this.isDestroyed is set to false inside of say3_options_object
//say3_options_list is set to be the first responder
function say3_options_list.onKeyDown(keycode, keytext, scancode) {
if (keytext == "d") {
// say3_options_list is inside say3_options_object
if (say3_options_object.isDestroyed == true) return;
say3_options_object.isDestroyed = true;
this.option = say3_options_list.getselectedrow(); // get row value
DestroySay3(); // function to destroy all GUI objects
}
}
After I added your suggestion it only loops twice (before it looped three times). I still don't understand why it loops at all.
Also after testing a little bit it doesn't look like onPlayerLeaves is called, at least if the player uses "unstick me". I am going to look into that a bit more.