Ok, so as far as I know, King is a special creature, and dies instantly. Due to that, it does not have the "is dying" parameter, or it is set to 0. You are checking the "is dying" on a creature that has 0 on that, due to that, the program may think that the condition was met, and exits.
Try altering the King in globals.