Using `ipairs` is not a good idea, since you have no guarantee that the monster IDs form a sequence.