Shop and Inventory System

How would you suggest I approach a shop and inventory system? Particularly the inventory aspect of it. I’ve considered saving a inventory table consisting of the player’s inventory that’s stored inside an inventories table, and then saving the inventories table. I’m not sure how efficient this is.

If this is the most efficient approach, how should I save the items inside the tables? Should I associate them with a name, should I ID them? What should I do?

Thanks in advance!

1 Like

Wait first off I need to know. Do you want it to save across servers? You most likely do, but it is still worth asking. If so I will begin making a script for that! Also I need to know the amount of slots the player will have in their inventory. Also can I get the GUI you are using for this inventory system?

  1. Yes, saving with datastores. 2) It’s an inventory, not backpack. 3) I’m not asking for someone to write it for me, I just am asking for advice on an approach.

If you want a player to have an unlimited amount of items you could simply store each item they pick up in a table and save that so if you want to display what they have you simply loop through the table and make each inventory slot accordingly

Oh i was willing to make it already lol and kinda started work on it lol but i will use it as in example of what i would do

Okay, could you possibly answer my other questions outlined in the post?

but what i would do is setup a custom GUI with a set amount of slots and just make a script in ServerScriptService as i would make a data store script and use it to make an inventory system that would save across servers using datastores. Im working on a visual example to show what i mean

And how should I save it? Please read the questions towards the end of the post

with roblox datastores. You would simply store the table of all the data instead of an individual value. If you want to be super secure you can use a prebuilt module like profileservice or datastore2 so you dont have to worry about saving messing up

Mate, I know to use data stores. Please reread my questions towards the end of the post

Then whats your question? you asked how you would save them in your previous reply. You are not being very clear

if your talking about how you would format the table then its up to your preference and how you would want to format your system.

Oh, I thought reread the end of my post was clear.

Well, I’m asking for suggestions and recommendations. Not my preference, I’m asking what would you do

thats not the same as saving items. Thats how to format your table. So yes, you are not being very clear. What I would do? It depends on the system. If each item is unique I would generate a GUID for each new item but if its a simple item that the player will have a quantity of I woudl simply store how much the player has as an integer in the table. It just depends on hwo your system is designed and how you liek to format your tables.

1 Like

Reread the end of my post was clear enough, thank you :relaxed:

And what is a GUID?

And they’re items such as pets, trails, titles, etc.

  1. saying my post was clear enough when I had to reread it multiple times makes your statement invalid

  2. A GUID is defined as " **GUID** (aka UUID) is an acronym for 'Globally Unique Identifier' (or 'Universally Unique Identifier'). It is a 128-bit integer number used to identify resources. The term **GUID** is generally used by developers working with Microsoft technologies, while UUID is used everywhere else." It is basically a unique ID that when is created is going to be a set of numbers that has never been made before, hence, an ID. You can generate a GUID with the function GenerateGUID of httpService. Dont forget to mark my post as a solution if this helps. :grin:

2 Likes