Best Way To Create An Inventory System

Hello developers! I created this post to once a for all see what the best way to create an inventory system is. What I mean by this is, for example, a pet inventory. The only way I have seen is through a dictionary, which I don’t believe is the best way. How do all the big games do it?

1 Like

for simulators I’ve worked on I do either 1 of two things.

  1. Assign an ID to each pet
    Ex:
local PetIDs = {
    "Pet1" = 1;
    "Pet2" = 2;
}

I prefer this way because its easy to store. I’m not sure if it is the most “compact” in size for datastores tho. But it makes data easy to read and modify:

local ownedPets = {12, 1, 1, 25}
  1. just save the names of the pets (I DID THIS FOREVER AGO DON’T RECOMMEND)
1 Like

How would you access this from the client?

I would use a module script to fetch data on the client

Sorry, don’t quite understand. Could you please explain a bit more?

If you want i can explain it to you

Yes please sdf lsdfklsdfjkl fsdf sdfsdf