Help for a function for my Map ❓

Hello everyone!

I was trying to build a map with special classes. One of those class has the ability to kill a random in a periode of time. I was trying a lot of stuff but still couldnt manage to get that system.

Thanks for help