So for the first time I’m going to dive into attempting to make an inventory system, I’m not sure if my way is an efficient way of doing it so I’m open to alternative ways if anyone has any.
I plan to have hundreds of weapons. Instead of storing them all in server storage, I’ve created a weapon dictionary in a module that uses InsertService:LoadAsset() to load players’ inventories when they join the game. These weapons are then added to a global inventory folder in server storage, allowing me to reference them when needed
I have a few questions about this method,
1: Is this an optimized way of doing it or is it completely unnecessary?
2: If each weapon were to vary in sounds, would It be best to put the audios in each model or add them through script once loaded with instance.new()?
3: What is the typical way a big game will do inventories when it comes to lots of tools/items?
4: Local script inside of tools or elsewhere? which structure is better, I’ve seen many different answers
Just leave them in serverstorage, calling insertservice is hard on networking and has the same result
Each is fine, but loading through a script might be easier if you store SoundIDs somewhere in an easy to read form.
If for some reason you need extreme optimization, I would say that storing the item’s current state in the client and then grabbing the original tool from serverstorage and loading the item’s state in it is the most performant way.
Dont ever do scripts inside tools, just make a centralized script. (Ex: Gunsystem script handles all gun tools). If you do a script per tool, it’ll become infernal to change any feature tied to a tool since you’ll need to go around changing the script of each single tool.
Main takeaway is to avoid duplicates of the same tool.
When I say scripts inside tools, i’m referring to local scripts, currently I have the local script inside server storage then I place it into the tool which the players have, this way I can edit it easily
I thought insert service my be a good idea because Ill have an ever increasing amount of weapons, maybe only loading what’s necessary is better for long term?