How can I destroy player's health bar etc. when player leaves the room?

Options
I'm instantiating a health bar for every player locally in each client (all players automatically create the health bars), I couldn't figure out how to destroy them when player is no longer in the game. Is there any way to know when a player's ship gets destroyed so I can access to it's components right before it's destroyed and destroy the health bar.