How would I display text on multiple lines?

So basically I have something that is like this.

local text = {
  line1 = 'Yeah'
  line2 = 'Yup'
  line3 = 'So cool and pro'
}

and I have a textlabel.

I want it to display line1, line2, and line3 all on separate lines on the textlabel.
Is there anyway for me to do this?

Use the newline character, which you can insert into a string literal via the control sequence \n.
For example:

local text = "Yeah\nYup\So cool and pro"

Or if you want to make it easier to read

local text = [[Yeah
Yup
So cool and pro]]

with Lua’s built in multiline string literal syntax.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.