How do I make an inventory script that stores data when you leave the game?

  1. What do you want to achieve? I would like to make an inventory system where when you click on a part, it saves in your inventory.

  2. What is the issue? Nothing, i would just like to learn it

Some extra questions i have is that do i need DataStore to achieve this for the saving part of the inventory system, or can the server save it?

I think this might help: How to save your players' inventory items

does it work if its a part, because the tutorial is using a tool

oh did u make a custom inventory or r u using the default one?

a custom one, sorry forgot to say it. also, the parts are placed in the workspace because i made the game to be built so the parts fall from the sky

Sry bro I’m not currently home so I can’t make the script.

But u can make a bool value for each item. And when the player is leaving u can check what the player currently has in their inventory and check the bool values for that item. Then u can save the bool values. Then when the player is added u can see what bools r true and add back whatever items r true.

I also forgot to mention to parent the bools to the player

okay, and how do i make the inventory system from scratch

Maybe try this one: Open Sourced Inventory/Backpack system
I haven’t used it myself but u can give it a try. Also u can try searching up on how to make ur own inventory system and there r many YT vids and dev forum posts on it.