Ok so I know how to make a table and a data store, however, i am facing two issues as far as coding goes. I can't find anything about this in any tutorial or wiki so I figured I would ask here. Anyways I am trying to make a database that will store a players items and stats. but the thing I am struggling to understand is this. Let's say a person has a strength of 5 but increases their level and their strength is now 6. I am not sure how to change this value within a table. sure I know how to change an intvalue but that's not what I'm trying to do. I think it would be much easier working with data in tables rather than creating over a thousand or so Intvalue, StringValue, or BoolValue. Which is why I would like to create a table and edit off that my question is how do I make a change in a table? I hope that made sense.
Ill make a quick example, the player steps on a switch or opens a chest, that chest will contain a 1 potion, so that would increase the total amount that player has in their inventory. I know how to do this for an intvalue or anything physical in game. but when it comes to a table that's where I am completely stomped.
local table = {"ThisChanges"} table[1] = "IntoThis" print(table[1])
local table = {["Strength"] = 1} table.Strength = table.Strength + 1 print(table.Strength)
I'm not in studio now, but I'm sure this works. I haven't worked with tables a lot right now, but I have done Data stores with them.