So I’m in need of some assistance for one reason. I’m not entirely sure if the way I’m making an inventory system is proper or not.
Step 1. Add Character To Table After Rolling It
Step 2. Have a localscript that’s firing an invokeserver returning the players inventory
Step 3. If there’s a new character add that character into the inventory gui while adding that character to a client version of the inventory table as well
Step 4. If a player clicks on this character, then we’re going to check the client’s inventory table to get all the stat points we want to display.
Step 5. When you click equip the character is added, but we check first through the server to assure that you’re exploiting a character in.
So for step 5 I’d simply just use a for loop on the player’s server table to check if the character as well as all the stats on the character own up to themselves. After that they equip the character simple as that.
An easier way to handle them without using a remote function every time would be to create a folder containing the inventory in ReplicatedStorage. This way, the client can directly access it.
There aee some different ways to do it, and im listing some down (your way does work though):
1- OOP (object oriented program):
You can make a table for each player and in each table you can make some kind of sorting like this:
Player Table → Keys that refers to the item name which will also be a table → Have the properties keys in the item (like [“Ammount”] = 2).
So it would look like this: print(player.BasicSword.Ammount)
I would use this one because it looks better, if you’d like you could use some metamethods and metatable things.
2- Make 2 different folders where one is at replicatedstorage and other is at serverstorage and use remote events and functions like you did. ( This is self explanatory )