So basically, I’ve set up the tables my players are gonna need in-script and not objects and like now simple tasks like removing something from a table is really hard and I have to make tons of for loops to get where I need to and it’s just harder to access stuff because I need to find the table then when i find the table i need to find its index then when i find its index i need to unpack the table of that table and it’s honestly just really too much, and I’m thinking of just switching to the object style like having folders and values
To me at least, I only use objects when the client actually needs to access them, other than that it’s tables.
Tables are much easier to use than objects, tables are much faster and more organized.
What does that even mean? if there are actual issues with you getting player data especially from a table then there is something seriously wrong with your server/data structure and you should consider reworking it (which I guess is what you’re planning to do).
Indexing with tables couldn’t be any easier:
Player A wants to equip Item X -> Player A Data.Inventory.Items[X’s ID] - Doesn’t exist = don’t equip, else equip.
Again, I personally prefer tables over Roblox objects with the exception of the client needing to actually access that specific data, but it really comes down to preference.
Yeah im having alot of trouble access different data that I put in those tables and its getting too complicated for my brain
This is what I have to do to access data like missions and like sometimes it says Im trying to index something with nil, something with a number, I know what the index and values are of a table its just Im using a table inside of a table inside of a table and its too confusing
Here is how many for loops I need to access a mission
If you want to visualize your data, then that’s completely fine, but I don’t think you should make your whole system use objects.
It’ll end up being the same, either way you’ll end up having instead of a table for Inventory you’ll have a folder, and for Items, Uncomplete Missions, and Complete missions you’ll end up having them as sub folders under that folder.
I’m assuming that your UncompleteMissions and CompletedMissions are both dictionaries, I am not sure why you have to loop through dictionaries to access the missions, Like what’s that for? (the code you just posted)…
Also making it Object Oriented wouldn’t really make it “easier” per se, it’s still tables and you’ll still have to do the good ol’ indexing (which isn’t that bad at all).