Let's say I buy a boat and I load it
how do I make it so when i die my boat goes away. But I still have the option to load it when I respawn.
I would a add a script with a global value that holds all possessions of the player. Add the script to the player at start and every time the player buys something add it to this array. Then add another global value that holds the possessions that are spawned.
_G[script].Possessions = {} _G[script].Possessions.Spawned = {}
You may want to put this inside the serverStorage and clone it to every user that joins the game. Now when a player dies, loop through the spawned objects
-- change the key (_G[*THIS*].Possessions.Spawned) to the above's script location for i, v in pairs (_G[script].Possessions.Spawned) do v:Destroys() end
Should be something like this, there are probably loads of other ways to do it, but this is what I can come up with. Good luck!