I want to know if stuff in dictionary tables can have more than one value. Like this.
local table = {
[“Player1”] = 1, true
[“Player2”] = 2, false
[“Player3”] = 3, false}
I want to know if stuff in dictionary tables can have more than one value. Like this.
local table = {
[“Player1”] = 1, true
[“Player2”] = 2, false
[“Player3”] = 3, false}
You can make it like this:
local table = {
[1] = {Item1, Item2}
}
For more than one value, you can try using this format:
local Table = {
["Player1"] = {
Number = 1,
Boolean = true
},
["Player2"] = {
Number = 2,
Boolean = false
},
}
By using Table.Number
or Table.Boolean
it will return the values that you setted.
Example:
TextLabel.Text = Table.Number -- this will return the number that you setted and it will change the text to the value. --
Let me know if there’s any error.
Ah, thanks! One question though, wouldn’t Table.Number not do anything since Number is inside of the other tables?
Yea that would not do anything
yep mb, this way is only if you’re using modulescript, since if you require it, you can return an full table.
you can use Table["Player1"].Number
.