Tools save after death

How to make tools save when respawn and leave

I do not know the code for this but you will need to use datastore if you want to save upon leaving.

when respawn = put tool in startergear
when leave = datastore