i have a dictionary like the following
{
[Player 1] = {},
[Player 2] = {},
}
i would like how know how to insert value to them like this
[Player 1] = {["money1"] = 100, ["money2"] = 200}
i have a dictionary like the following
{
[Player 1] = {},
[Player 2] = {},
}
i would like how know how to insert value to them like this
[Player 1] = {["money1"] = 100, ["money2"] = 200}
You can’t actually do that, it has to be a string.
['Player 1']
Also this is how you do it.
Table['Player1'] = {['money1'] = 100, ['money2'] = 200}
-- or you can do this V
local i = 1
Table['Player' .. i] = {['money1'] = 100, ['money2'] = 200}
sorry to bother you again but what how would i insert extra values maybe like money 3 without overriding the previous variables. i was told to not use table.insert for dictionaries
Table['Player1']['money3'] = 100
Are you sure this doesn’t clear the previous tables. If so then there’s something wrong with my code
Yes, it does not clear the previous tables. There might be somerthing wrong with your code.
thank you for your time, ill mark as solution again
But it might error if Player1
does not exist.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.