How do i make a miss system

Hello, I have been trying to make a miss system, it is like you need to get hit a specific amount of times and when you get hit a border GUI with a miss text shows up next to your character so then after you get hit a specific amount of times you die I’ve tried before but I literally didn’t save the game after I did it… if someone can tell me I will appreciate it a lot because I’ve been trying for a long time!