Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make an efficient inventory system?

I am currently working on a game with a friend, and we are both stumped on making an inventory for our dungeon crawler. Everything other than the inventory is going well but, we just don't know how to make an efficient inventory system that saves across multiple places (such as when you're in a level it knows what you have equipped from the lobby), we also don't want to use the default Roblox backpack, as it can get pretty messy if you have a lot of items and it can't handle armor. We do not want a whole script on how to make this inventory system, we just need some pointers to help us start off.

We were thinking of making a system with values for items which the inventory displays by constantly scanning every item in the game, which is very inefficient.

1 comment

0

I could help with your game if you convert it into an open world

1 answer

✓ Accepted answer

Make a bunch of Folders with loops like so :

local MaxSlots = 25 -- A really small inventory

local Inventory = Instance.new(“Folder)
Inventory.Name = (“Inventory”)
Inventory.Parent = -- Player Variable goes here

for i = 1,MaxSlots,1 do
      local Slot = Instance.new(“Folder”) -- I use folders to store more info such as the itemname,stats,enchant and etc.
      Slot.Name = “Slot”..i 
      Slot.Parent = Inventory
end 

This should make an inventory and 25 slots inside of it

1 comment

0

I could show you how to manage the GUI Disc : Mars #1202

This discussion is preserved as it was. New answers, comments, and votes are closed.