Saving added accessories on death

Hey guys!

So today I made an accessory system. Basically it equips the accessory when you press a GUI button. It works really well… except one thing.

When the players die, the accessories do not re-appear on the character. Is there any way to fix this without using datastores?

I suggest storing it in a table and when the player leaves remove them from it.

1 Like

There’s a couple methods you could go about this.

Method 1

Save the equipped assets in a table stored on the server, and each time the player respawns read from the table to create and equip each asset on the character using the Humanoid.Died and Player.CharacterAdded events.

Method 2

You could use a Humanoid.Died event, where you iterate over the children of the character and if it’s an accessory you want to preserve, you could parent it to nil while storing it in a table, then wait for the character to respawn and parent those stored accessories into the new character.

2 Likes

Alright. I am going to try Method 2. Hold on one second.

1 Like