How do I make an inventory system?

How would I make an inventory system? The inventory system I want to make will check if a player owns that weapon. If that player does own it he or she will be able to equip it. I also want to make it so that the player cannot buy that weapon from the shop if they already own it.

I’ve looked all over dev forums and the only thing I found about this question is to create tables that store weather the player owns that item or not. I’m not sure how I would create a table for every player in the game. What would the syntax be like if I did that? Would I store those tables in a module script?

Is there any better way of making an inventory system?

2 Likes

You’ll likely want to use a DataStore since it lets you save data across game sessions. It acts like a table in which it saves data for a certain key.

2 Likes

I use profileservice for this as it caches the player data allowing the server to easily grab that inventory data and edit it.

1 Like