Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

is it possible to do this: a.Text = Variable"string" ?

Asked by 9 years ago

so my variable is a string but for some reason it won't work? is it possible to say: example = "Hello" a.Text = example" World" all in one line?

0
Both of the answers are correct. This is called "string concatenation", and the operator for it in Lua is `..` I would suggest putting a space before and after it however. adark 5487 — 9y

2 answers

Log in to vote
3
Answered by 9 years ago

Yes, it is very possible to set the Text of a Gui to a variable, you would use two dots to combine the variable with a string. Like so:

example = "Hello"
a.Text = example.." World"
0
thanks :D FrozenWinterz 50 — 9y
0
No problem. (: Shrekerly 70 — 9y
Ad
Log in to vote
2
Answered by 9 years ago

This is possible, but you're doing it wrong. Here's how you could do this.

VariableName = "Hello"
a.Text = VariableName.." World"

Answer this question