In a message, how do you add table strings(?) to the message's text?
1 | table = { "hi" , "pizza" , "four" } |
2 | mes = Instance.new( "Message" ,workspace) |
3 | mes.Text = "" ..table.. "" -- trying to make it say: Text="hi, pizza, four" |
4 | -- No, I'm not trying to do: mes.Text=""..table[1]..""..table[2]..""..table[3].."" |
5 | -- WHAT IS THIS SORCERY |
I'm sorry if this is confusing.
So.. you're trying to make it have all the elements in a table, but not have to list each one individually?
1 | --Anyway if that's what you meant, then use "table.concat". |
2 |
3 | local table = { "Hey" , "More pizza" , "Five" } |
4 | mes = Instance.new( "Message" , Workspace) |
5 | mes.Text = table.concat(table, " " ) |
6 |
7 | --The first argument is the table, the second argument is what seperates each element. E.G if I were to put 'table.concat(table,"!")', then the message text would be "Hey!More pizza!Five" |