Players = {'gary','bob','jeff'}
How could I assign a value to “gary” or “bob” for instance, like a score which can be retrieved later.
Those are already values, you can edit them with a new value by getting their index. The table goes in order starting at number 1.
So, to change ‘gary’ to ‘john’ for example, you do this:
Players[1] = ‘john’ — overwrite gary to john
You can access them by index: Players[1] for future reference.
I know that, but how could I go about assigning a number or different value to “gary” so that I could do something like Players("gary").Points = 1 for instance.
You could instead use those as indexes to make a dictionary table:
local Players = {
[‘gary’] = 2 — his points
}
1 Like
Wrong! It’s accurately Players[1] = 'john` – overwrite gary to john