Sword Fight Steal Time | Inventory Tool Saving

I have a sword fight and steal time experience and in the game I have a shop GUI with different swords which works perfectly fine, on top of that I have the custom hotbar and inventory which is also good. There is just one problem, when players get killed or rejoin the experience they have to re-equip the swords from the shop where they bought them (not purchase) which is very annoying.

I’d appreciate it if someone helps!

Images that I think may help

Screenshot 2024-02-04 at 11.28.59

1 Like

If I understood correctly, you need a value in your datastore called something like EquippedSword and store the sword there, then load when the player joins?

If you’re saying that the sword should be equipped when the player joined, then no. Also, I don’t really know how to script, that’s why I’m seeking help. I need the purchased swords to stay in the player’s inventory that is not the default Roblox inventory. It’s the custom inventory in the game and when the player gets killed or joins then it’s in their backpack or hotbar slot wherever they placed it.

1 Like

I went into your game, I see I spawned with the default sword. Am I understanding correctly that if I buy Diamond Sword and equip it and rejoin, I’ll have the default sword equipped and will have to re-equip the diamond sword from the store again, but you want it to be equipped straight away?

1 Like

Example: You purchase a sword, idk like Elite sword. You get killed, it’s still in your inventory/hotbar, you get killed again then it’s not there or same thing but instead of killed it could be rejoining.

My point is, sometimes when the player gets killed or rejoins it doesn’t save, and sometimes it does, it’s pretty annoying.

you should probably add a variable (most likely a list/table) in a script that can be accessed when the player dies (use player.CharacterAdded to detect this) to see what they had equipped and manually add it from there

for when they rejoin you just have to save that same variable to a data store