Script for detecting when a player dies

I am trying to create a map where an object follows a player. How would I go about scripting an item so that when a player with a label (alpha, bravo, etc.) dies, it will despawn and respawn say, 5 seconds later?

I think you could use continuous boundary checks to see if a player is not inside. Then when there isn’t a player inside it should start to countdown from 5 as a timer causing it to despawn and respawn. that is a bit abstract but it might work

> 2533274888753908;2:
> I think you could use continuous boundary checks to see if a player is not inside. Then when there isn’t a player inside it should start to countdown from 5 as a timer causing it to despawn and respawn. that is a bit abstract but it might work

I thought about that, but then I found out that dead bodies also count as players. The despawn/despawn thing is only there so that there isn’t floating armor on the map. As far as I know, there IS a way to detect it,but so far, IDK. I’ll try it though.