I just have a quick question because I’m trying to make an inventory system
If I store the player’s items in a module script and have all the functions like add/remove in it too, would that be a good way to start it? Or should I do it a different way
Example:
local InventoryModule = {}
local inventory = {
slot1 = "empty",
slot2 = "empty",
slot3 = "empty",
slot4 = "empty",
slot5 = "empty",
slot6 = "empty",
slot7 = "empty",
slot8 = "empty",
slot9 = "empty",
}
function InventoryModule.AddItem()
end
function InventoryModule.RemoveItem()
end
return InventoryModule
I was thinking I store the item names in the slots but I want to know the best way to go about it
This is a fine way to do it, but be aware that each module script is only loaded once, so this will only give you one inventory shared for each script that requires it. This would be perfect on the client but not useful on the server, since you wouldn’t be able to have multiple inventories for multiple players.