Problem with Backpack

I’m having a problem with the player’s backpack. I’m trying to make a script that runs when something is added to the player’s backpack, but there are two issues: when the player equips the tool, it is added inside the character, so when they unequip it, it thinks a new tool has been added, and I’m not sure if I can use tables because the player could have tools with the same name. And I’m pretty sure that whenever the player dies, a new backpack is created, which stops the connect function; I’m not sure how to fix this. I would be grateful if someone could assist me with this; I am unable to provide any of my code with this.

It sounds like a item-table with DataStore is your solution.

Make a table for stored items, and a table for equipped items.

Instead of detecting whenever a new tool is added to the players backpack, you will manually script when the tables should be updated.

Ect. make remoteEvents for when the client tries to equip their tool in the backpack, and check on the server if they have the tool in their stored items, if they have that, move it from the stored items into equipped items. (And put the tool into their character & equip it for them)

It will work like a custom inventory system.

2 Likes

I’m not sure how the DataStore part would work, but using Remote Events seems like a good idea.