How to count the kill of a player on a quest

Hello. There was a problem with completing a custom quest in which you need to kill a certain number of players. Set flags in the quest, but does not count the player’s kill. Perhaps someone faced such a problem?